ÃÈеIJñ¼¦ÎÊÌâ
±¾Ìû×îºóÓÉ zb7886475 ÓÚ 2019-7-30 11:21 ±à¼python µÄ¶ÏÐÐÔõô¶ÏÀÏÊÇ´íÎó
import random
import time
###ÌáʾÓﲿ·Ö
print('ÄãºÃ£¬ÎÒÊÇ»úÆ÷ÈËСÂñ£¬ÎÒÃÇÀ´Íæ¸ö²ÂÄêÁäµÄСÓÎÏ·°É¡«(¡ô◡¡ô)')
time.sleep(2)
print('''
=============================
¸ÉÎïÃ㡤¦¤Þ¤ë¤Á¤ã¤ó¤ÎÄêýh
=============================
''')
time.sleep(1)
print('СÂñµÄÕæʵÄêÁäÔÚ1µ½10Ö®¼äŶ¡«')
time.sleep(1)
print('²»¹ý£¬ÄãÖ»ÓÐ5´Î»ú»áŶ¡«')
time.sleep(1)
print('ÏÂÃ棬ÇëÊäÈëСÂñµÄÄêÁä°É£º')
#´Ó0ÖÁ10²úÉúÒ»¸öËæ»úÕûÊý£¬²¢¸³Öµ¸ø±äÁ¿age
age = random.randint(1,10)
#ÉèÖôÎÊý
for guess in range(1,6):
#ÊäÈëÍæ¼Ò²Â²âµÄÄêÁä
choice=int(input())
#ÅжÁÍæ¼ÒÊäÈëµÄÄêÁäÊÇ·ñµÈÓÚÕýÈ·µÄÄêÁä
if choice<age:
print('СÂñµÄÌáʾ£ºÄã²ÂСÁË£¨£»¡ä§Õ£à£©©g¡£¡£¡£¡£')
elif choice>age:
print('СÂñµÄÌáʾ£ºÄ˲´óÁËÈÇ(£¾©n£¼)¡«¡«')
else:
print('²ÂÁË'+str(guess)+'´Î£¬Äã¾Í²Â¶ÔÈÇ¡«hiu(^_^A;)¡«¡«¡«')
break
#Åжϲ²â´ÎÊý
if choice== age:
print('ËѸÁ¡«ÄÇôСÂñÏÂÏßÁË¡«°Ý°Ý¡«£¨£þ¦á£þ£©¨J')
else:
print('°¥Ñ½¡«Ä㻹ÊÇľÓв¶԰¡¡«µ«ÊÇÄãÖ»ÓÐ5´Î»ú»áÚÀ¡«Ôõô°ì°¡¡«')
print('ÄǺðɡ«ÐÄÈíµÄСÂñÖ»ºÃ¸æËßÄ㣬ÎÒ²Å'+str(age)+'ËêŶ¡«(*/¦Ø£Ü*)') ÖÁÉÙ·¢¸ö´úÂëÉÏÀ´Ñ½ Ìù¸ö´úÂë°É ³ÌÐòûÓдíÎó
ÄãºÃ£¬ÎÒÊÇ»úÆ÷ÈËСÂñ£¬ÎÒÃÇÀ´Íæ¸ö²ÂÄêÁäµÄСÓÎÏ·°É¡«(¡ô◡¡ô)
=============================
¸ÉÎïÃ㡤¦¤Þ¤ë¤Á¤ã¤ó¤ÎÄêýh
=============================
СÂñµÄÕæʵÄêÁäÔÚ1µ½10Ö®¼äŶ¡«
²»¹ý£¬ÄãÖ»ÓÐ5´Î»ú»áŶ¡«
ÏÂÃ棬ÇëÊäÈëСÂñµÄÄêÁä°É£º
9
СÂñµÄÌáʾ£ºÄ˲´óÁËÈÇ(£¾©n£¼)¡«¡«
5
СÂñµÄÌáʾ£ºÄ˲´óÁËÈÇ(£¾©n£¼)¡«¡«
3
²ÂÁË3´Î£¬Äã¾Í²Â¶ÔÈÇ¡«hiu(^_^A;)¡«¡«¡«
ËѸÁ¡«ÄÇôСÂñÏÂÏßÁË¡«°Ý°Ý¡«£¨£þ¦á£þ£©¨J zltzlt ·¢±íÓÚ 2019-7-30 11:34
³ÌÐòûÓдíÎó
лл ÎÒµ÷ÊÔÁË°ëÌìÀÏÊDZ¨´í
Ò³:
[1]