shijt

自学python第一周,学了变量和简单的条件判断。

附上猜数游戏代码

 1 #Author:shijt
 2 trueAge=40
 3 count=0
 4 while count<3:
 5     guessAge=int(input("how old is he?"))
 6     if guessAge==trueAge:
 7         print("yes,great!")
 8         break
 9     elif guessAge>trueAge:
10         print("too big")
11     else:
12         print("too small")
13 
14     count+=1
15     if count==3:
16         flag=input("do you want to countine?")
17         if flag!=\'n\':
18             count=0

以后可以在简历上写上:

精通python。。。。。。。hello,world的输出

 

分类:

技术点:

相关文章:

  • 2021-07-12
  • 2022-01-23
  • 2021-06-01
  • 2021-09-11
  • 2021-11-14
  • 2021-04-06
  • 2021-12-03
  • 2021-08-17
猜你喜欢
  • 2022-01-09
  • 2021-09-19
  • 2021-11-08
  • 2021-12-13
  • 2021-05-30
  • 2021-05-23
  • 2021-08-18
相关资源
相似解决方案