Python3 compatible memo of "python start book"

The "python Startbook" is a highly recommended book for programming beginners to learn python while learning the concept of programming. However, since this book is a little old (2010) and only supports python2, I have summarized the confusion when studying python3 using this book.


Overall. On paper, at the beginning of the script # coding:utf-8 However, in python3, the character code is utf-8 by default, so it is unnecessary.


BMI calculation and so on. raw_input () is not in python3. → Use input ()


Create your own module, import it, and reload it. Reload () function is obsolete in python3

import importlib
importlib.reload(my_module)

Where to use the map () function. When it looks like map (str, [1,2,3]), the result is different from the one on paper.

→ In python2, it is automatically returned as a list format, but in python3, it is not returned. You need to enclose it in list ().

list(map(str, [1,2,3]))

reference

http://qiita.com/mriho/items/52f53559ba7fe7ef06ff

Recommended Posts

Python3 compatible memo of "python start book"
python recipe book Memo
Python --Quick start of logging
[Python] Operation memo of pandas DataFrame
Python memo
python memo
Python memo
Start python
python memo
Python memo
Separate display of Python graphs (memo)
Python memo
Python memo
Memo of troubles about coexistence of Python 2/3 system
[Python] Memo dictionary
Introduction of Python
python beginner memo (9.2-10)
python beginner memo (9.1)
Python quick start
Basics of Python ①
★ Memo ★ Python Iroha
[Python] Start studying
Basics of python ①
Copy of python
[Python] EDA memo
Python 3 operator memo
[My memo] python
Python3 metaclass memo
[Python] Basemap memo
Python beginner memo (2)
[Python] Numpy memo
Introduction of Python
A memo of a tutorial on running python on heroku
Python & Machine Learning Study Memo ⑤: Classification of irises
Python & Machine Learning Study Memo ②: Introduction of Library
Get the update date of the Python memo file.
[Python] Operation of enumerate
Python class (Python learning memo ⑦)
My python environment memo
python openCV installation (memo)
A memo connected to HiveServer2 of EMR with python
Python module (Python learning memo ④)
Visualization memo by Python
Unification of Python environment
Copy of python preferences
Basics of Python scraping basics
[python] behavior of argmax
Python test package memo
[Python] Memo about functions
Usage of Python locals ()
the zen of Python
python regular expression memo
Installation of Python 3.3 rc1
The pain of gRPC using Python. November 2019. (Personal memo)
Python3 List / dictionary memo
[Memo] Python3 list sort
Python Tips (my memo)
Programmer's way of thinking is from XX book (Python)
[Python] Memo about errors
DynamoDB Script Memo (Python)
Python basic memo --Part 2