📜  随机数生成器 python 代码示例

📅  最后修改于: 2022-03-11 14:45:21.431000             🧑  作者: Mango

代码示例6
# Random Number Generator
## Small Python Game
## You will win if you guess a number greater than the system generated number

import random

uNum = int(input("Enter a number between 0 and 100: "))
sNum = random.randint(0,100)

if uNum > sNum:
  print("You Win!!!")
else:
  print("Try Again!!!")

print("Your Number:", uNum, "\nSystem Number:", sNum)