1,安装anacoda后测试,安装详细见https://blog.csdn.net/qq_40008325/article/details/89972269
打开spyder,新建文件,测试代码:
运行代码窗口:
2,新建一个test.py,测试代码
#test.py
print ("hello word")
sum_tmp = 0
for i in range(1,101,1):
sum_tmp+=i
print(sum_tmp)
#字符串的定义和引用和字符串的访问
person_wan = ["1001","tangtao",27,"2019-05-28","english"]
print(person_wan)
print(person_wan[2])
print(person_wan[-1])
print(person_wan[1:4])
#函数的定义和引用
def fun(para_one,para_two):
return para_one*para_two
a = fun(1,8)
print(a)
t1 = 'hello'
t2 = 100
print(type(t1))
print(type(t2))
#定义字典树
dst ={"1001":"tangtao","old":12,"subject":"chinese","score":90}
print(dst)
print(dst["old"])
print(dst["score"])
src ={"1001":"limeng","name":"wumng"}
print(type(src))
3,运行结果: