Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

random number generator python

# 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, "
System Number:", sNum)
Source by machinelearningmastery.com #
 
PREVIOUS NEXT
Tagged: #random #number #generator #python
ADD COMMENT
Topic
Name
8+7 =