Welcome to Code Sharer, a code gallery for creating, saving and sharing all kinds of code snippets.

Python — A very SUDO random number generator

Posted On: Wednesday, December 14, 2016 at 8:20 AM

A very SUDO random number generator
import random

x = int(raw_input("Please enter a number up to 100. "))
z = random.randint(40,100)


randomNumber = random.randint(1,z)
print "first random",randomNumber


if 35 >= randomNumber:
newRandom = randomNumber * .5
newRandom = newRandom + 9
print "second random " "%.f" % newRandom

elif 36 <= randomNumber <= 93:
newRandom = randomNumber + 7
print "second random " "%.f" % newRandom

else:
newRandom = randomNumber
print "second random",newRandom

Ryan Bradley-Evans (Admin)

Joined on
Contributed 22 Snips

Get Social and Share

Tags