1.程序输出——print语句
>>> myString = ‘Hello World!‘ >>> print myString Hello World! >>> myString ‘Hello World!‘
注意:在仅用变量名的时候,输出的字符串是用单引号括起来的
2.程序输入——raw_input()内建函数
>>> user = raw_input(‘Enter your name:‘) Enter your name:root >>> print ‘Your name is:‘,user Your name is: root
3.注释——使用#
时间: 2024-12-15 22:36:26