2019独角兽企业重金招聘Python工程师标准>>>
My first Python demo
>>> movies=["a","b","c"]
>>> print(movies[0])
a
>>> print(movies[1])
b
>>>
>>> print(movies)
['a', 'b', 'c']
>>> print(len(movies))
3
>>>
Python 的变量标示符没有类型
Python定义变量为stirng类型后,可以tab查询可用的api
for或者while循环语句后加:后,再写逻辑代码
定义的变量支持混合类型 movies=["a","b",1823,1234]
变量可以直接定义,不需要声明
>>> count =0
>>> while count<len(movies)
SyntaxError: invalid syntax
>>> count =0
>>> while count<len(movies)
SyntaxError: invalid syntax
>>> while count<len(movies):
print(movies[count])
count++
SyntaxError: invalid syntax
>>> while count<len(movies):
print(movies[count])
count=count+1
a
b
c
d