Record of Python introduction for newcomers

Introduction

Recently, I had the opportunity to teach Python to new employees in the workplace for a short period of time, so I would like to summarize what I did at that time. The motivation for choosing Python for newcomer education is as follows.

By the way, the newcomer has mastered C ++ to some extent before that, and has no programming experience before that.

Preparing the environment

The first is the preparation of the environment.

pyenv Since the OS used Ubuntu, Python was included from the beginning, but I wanted to have experience of installing it, so I created an environment with pyenv. At the same time, I have told you that Python has 2 and 3 systems. This time I'm using Python 3.6.2.

Hello world! Once Python is in, create hello.py and it's Hello world!. Since the editor used Visual Studio Code, it was ready just by inserting the extension for Python. Here you can learn how to run python.

$ python hello.py

Jupyter Notebook Install Jupyter because it is convenient to have an interactive execution environment to write learning code in the introduction. At this time, pip is explained. At first, I looked at the introductory site and asked Jupyter to write the code while summarizing it to some extent. It also introduces an online execution environment such as paiza.io.

Mastering basic grammar

Dive Into Python 3 http://diveintopython3-ja.rdy.jp/index.html

For the time being, I asked him to write the code in Jupyter while looking here. However, I didn't have much time, so it seems like the first half is rough. Such a page is helpful. Personally, I think Python will be fun if you can make good use of list comprehensions.

Practical coding

Google Code Jam https://code.google.com/codejam/past-contests

I asked them to solve a simple past question of Google Code Jam by selecting it from the Qualification Round. The aim is to teach basic file input / output, character string operations, and simple algorithms. For example, I think that the knowledge here will be useful when writing a script that analyzes some kind of log file. Also, here are some techniques (?) That are useful to know when you have Google Code Jam solved.

with open('./sample.in') as f:
    #Remove annoying newline characters at the end with slices
    line = f.readline()[:-1]
    #Unpack assignment of space-separated data to individual variables
    a, b, c = f.readline()[:-1].split()
    #If you want to make it int, convert it with list comprehension notation
    a, b, c = [int(x) for x in f.readline()[:-1].split()]

Slackbot I thought that I would get bored even if I wrote only the code I was studying, so I asked him to make a program that was easy to make but had a slightly amazing feeling. This time, as a theme, I have Slackbot made because I use Slack at work. It was easy to implement by referring to here. As a device, I made it to return the weather forecast. Obtaining the weather forecast with Python was also easily realized by referring to here.

01.png

It seems that it was fun for newcomers to make this. Good: smile:

Django Girls Tutorial https://djangogirlsjapan.gitbooks.io/workshop_tutorialjp/content/

This is just an introduction because the period is not enough, but it will be a tutorial for creating a web application using Django. It is wonderful that it is explained carefully enough to proceed without knowledge of Web development. In the tutorial, CSS is also prepared and it looks good, and since it is also deployed using Heroku, it is completed, and I thought that it would be fun to make it like the above Slackbot. I introduced it. I would like you to take on the challenge.

in conclusion

Although it was a short period of time, I was able to create a working program and it was fun for the teaching side. I hope you like Python.

Recommended Posts

Record of Python introduction for newcomers
Introduction of Python
Introduction of Python
Introduction of activities applying Python
Introduction to Python For, While
A record of patching a python package
■ Kaggle Practice for Beginners --Introduction of Python --by Google Colaboratory
Introductory table of contents for python3
An introduction to Python for non-engineers
[Python] Minutes of study meeting for beginners (7/15)
General Theory of Relativity in Python: Introduction
Summary of various for statements in Python
Easy introduction of speech recognition with Python
Pandas of the beginner, by the beginner, for the beginner [Python]
Summary of useful techniques for Python Scrapy
An introduction to Python for machine learning
Easy introduction of python3 series and OpenCV3
[Introduction to Data Scientists] Basics of Python ♬
An introduction to Python for C programmers
2016-10-30 else for Python3> for:
python [for myself]
Introduction of scikit-optimize
Introduction of PyGMT
Basics of Python ①
Basics of python ①
Copy of python
Introduction of cymel
[Introduction to Udemy Python 3 + Application] 26. Copy of dictionary
The story of low learning costs for Python
Python & Machine Learning Study Memo ②: Introduction of Library
Introduction of Python Imaging Library (PIL) using HomeBrew
Image processing? The story of starting Python for
Easy understanding of Python for & arrays (for super beginners)
[Introduction to Udemy Python3 + Application] 43. for else statement
Kyoto University Python Lecture Material: Introduction of Columns
Summary of frequently used Python arrays (for myself)
A well-prepared record of data analysis in Python
[Python for Hikari] Chapter 09-01 Classes (Basics of Objects)
[Introduction for beginners] Working with MySQL in Python
Basic story of inheritance in Python (for beginners)
[Introduction to Python] Basic usage of lambda expressions
Understand Python for Pepper development. -Introduction to Python Box-
[Introduction to Python] How to get the index of data with a for statement
Use data class for data storage of Python 3.7 or higher
About Python for loops
[Python] Operation of enumerate
List of python modules
Introduction of trac (Windows + trac 1.0.10)
Operate mongoDB from python in ubuntu environment ① Introduction of mongoDB
Python basics ② for statement
Unification of Python environment
Introduction of mathematical prediction model for infectious diseases (SIR model)
List of Python libraries for data scientists and data engineers
Introduction of ferenOS 1 (installation)
Python netCDF4 read speed and nesting of for statements
List of sample program distribution sites for python books
[python] behavior of argmax
Summary of python environment settings for myself [mac] [ubuntu]
Use urlparse.urljoin instead of os.path.join for Python URL joins
Summary of tools for operating Windows GUI with Python
[Chapter 5] Introduction to Python with 100 knocks of language processing