python输入输出及基础

输出
自动添加空格

1
2
3
4
5
6
>>>print('hello world')
hello world
>>>print('The quick brown fox', 'jumps over', 'the lazy dog')
The quick brown fox jumps over the lazy dog
>>>print('1024 * 768 =',1024*768)
1024 * 768 = 786432

输入

1
2
>>>name=input('please input your name:')
>>>print('name:',name)

采用缩进方式
当语句以冒号:结尾时,缩进的语句视为代码块
Python程序是大小写敏感的
使用4个空格的缩进
#开头的语句是注释