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]))
http://qiita.com/mriho/items/52f53559ba7fe7ef06ff
Recommended Posts