注释
# This program says hello and asks for my name.
print()函数
print()函数将括号内的字符串显示在屏幕上。
print('Hello world!')
print('What is your name?')
input()函数
函数等待用户在键盘上输入一些文本,并按下回车键。
myName = input()
len()函数
你可以向 len()函数传递一个字符串(或包含字符串的变量),然后该函数求值
为一个整型值,即字符串中字符的个数。
(交互模式中,有自动打印出来的功能)
>>> len('hello')
5
>>> len('My very energetic monster just scarfed nachos.')
46
>>> len('')
0