标签:count 函数名 apple color print code pre hello bsp
1 # 2 # s = ‘nihao‘ 3 # count = 0 4 # for i in s : 5 # count += 1 6 # print(count) 7 8 # dic = dict((‘name‘,‘apple‘)) 9 # print(dic) 10 11 # def mylen(): 12 # s1 = "hello world" 13 # length = 0 14 # for i in s1: 15 # length = length+1 16 # print(length) 17 # 18 19 #封装函数 20 def info (): 21 print(‘zahnghangming‘) 22 print(‘age=17‘) 23 #函数名() 24 info() # zahnghangming age=17 25 #调用函数 26 27 28 # 求两个数的和: 29 # a=5 30 # b=3 31 # print(a+b) 32 33 #封装函数 34 def he (): 35 a=5 36 b=3 37 print(a+b) 38 he() #调用函数 #输出: 8 39 40 41 #练习 42 def jh (): 43 s=input(‘请输入qq号:‘) 44 print(‘输入正确‘) 45 jh()
标签:count 函数名 apple color print code pre hello bsp
原文地址:https://www.cnblogs.com/zhmz/p/13353879.html