作业1
A.if = 18 #可用,但不适用。不以关键字做为标识符B.01_a = 1 #数字不能做为开头C. name = 'qianan'D. 年龄 = 18E. weight% = 160 # % 不能用于标识符
作业2
a = 6
b = 8
实现 a = 8,b=6
a=6b=8b=aa=8print('a =',a)print('b =',b)#下面是另一同学启发的逻辑更简洁a = 6b = 8a , b = b , aprint('a =',a)print('b =',b)
作业3
用户输入 telephone
判断 telephone是否为全数字
是,则打印输出 telephone
否,则打印输出 telephone格式错误
abc = input('请输入您的号码')if abc.isdigit():print(abc)else:print('您的输入有误,请重新输入')#另一个同学的逻辑a = input('请输入您的号码:')s = a.isdigit()if s == True:print(a)else:print('输入错误,请重新输入')
作业4**
print(‘hello’)
print(‘world’)
使用一个print语句实现
上面两个print()语句输出的效果
print(' hello \n world')#另一同学的逻辑print('hello',world,sep='\n')
