Python读书笔记
自己写读书笔记,记录下自己的python学习中遇到的一些问题或者一些奇怪的东西。
1.
1 | #! /usr/bin/env python3 |
执行后会报错
1 | TypeError: '>=' not supported between instances of 'str' and 'int' |
原因是input()输入的是str类型,需要将其转成int型。
1 | int(input("input your age:")) |
自己写读书笔记,记录下自己的python学习中遇到的一些问题或者一些奇怪的东西。
1.
1 | #! /usr/bin/env python3 |
执行后会报错
1 | TypeError: '>=' not supported between instances of 'str' and 'int' |
原因是input()输入的是str类型,需要将其转成int型。
1 | int(input("input your age:")) |