1、输出
print ("hello, world")
#逗号隔开
print('The quick brown fox', 'jumps over', 'the lazy dog')
#计算
print('1+2=',1+2)
#反斜杠 \n换号,\t制位
print('I\'m learning\nPython.')
#直输r
print(r'I\'m learning\nPython.')
#直输换行
print('''line1
line2
line3''')
2、输入
name = input('what\'s your name ?')
print ('hi,',name)
3、python:缩进方式,大小写敏感
#默认字符串,强制转换
a = int(input("input a number"))
if a >= 0:
print(a)
else:
print(-a)
4、编码
print(ord('A'))
print(chr(66))
print('ABC'.encode('ascii'))
5、list
从0开始有序集合
classmates = ['Michael', 'Bob', 'Tracy']
print (classmates)
print (classmates[0])