python第一课的课堂笔记整理

介绍了计算机发展历史,操作系统的发展历史。Unix分支出Linux,mac,windos,发展来历

编码历史由ASCII到现在的Unicode的发展变化

用cmd 进行了文件打开,查看文件。编码了第一个编程

1.“hello world” 学会了使用 print

print(“hello world”)

2.变量使用

name=zhangshan

name2=lishi

print(“name,name2”)

变量使用的规则

a.只能以字母或者是数值组成,不能用符号表示

b.只能用清晰的描述做变量

c.不能用中文表示

""括起来的就是字符串,没有就是变量

int,可以把字符串变成数据

str,可以把数据变成字符串

 

写了一个片段年岁的编程

death_age=80

your_age=int(input("age:"))

print("yuo can strill live"+str(death_age-your_age)+"year")

 

用户交互的小编程

age_of_president=80

guess_age = int(input("guess_age:"))

if guess_age==age_of_president:
print("you are great")

else:
print("you are worng")

 

if 和else 的使用

scroe= int(input("scroe:"))
if scroe>90:
print("A")
elif scroe>80:
print("B")
elif scroe>70:
print("C")
else:
print("sha bi")

 

posted on 2017-12-24 22:17  陆乾云坤  阅读(126)  评论(0)    收藏  举报