
function:python基础语法练习@H_301_4@"""@H_301_4@#import thisname = "tom"age = 29str1 = "hello," + name + "; age," + str(age)str2 = "hello,%s ; age,%d " %(name,age)str3 = "hello,{n} ; age,{a}".format(n=name,a=age)print(str3)# n = input("input you name:")# print("hello-->",name)# 引号的使用print("他说:'你好'! ")print('他说:"你好"! ')''''''# 顺序、分支、循环@H_301_4@"""a == b 相等a >= b 大于等于a <= b 小于等于a != b 不等于a is b 是a is not b 不是@H_301_4@a = 4b = 5if a > b:print("a big")else:print("b big")if True:print("run this info")c = Trueif c is True:print("run this info")if c is not False:print("run this info")d = Noneif d is None:print("d is None")number = 77if number > 90:print("优秀")elif number > 70:print("良好")elif number > 60:print("及格") else:print("不及格")hello = "hello"for i in hello:print(i)
总结
以上是内存溢出为你收集整理的python3基础1全部内容,希望文章能够帮你解决python3基础1所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)