Challenges

August-report
Spencerscooper 1 year ago
parent b8e3a96bc8
commit b925a9eb85

@ -16,3 +16,9 @@ print("Welcome Student", Studentsname1.person())
print("Welcome Student", Studentsname2.person())
print("Welcome Student", Studentsname3.person())
http://www.openbookproject.net/pybiblio/gasp/course/1-intro.html
http://www.openbookproject.net/pybiblio/gasp/course/2-tables.html

@ -0,0 +1,48 @@
from gasp import *
from random import randint
#Challenge 6 & 7
showingnumber1 = randint(1,100)
showingnumber2 = randint(1,100)
print("What number can be added to " + str(showingnumber1) + " to give you 100")
user_input = int(input(""))
if user_input + showingnumber1 < 100:
print("value is small")
elif user_input + showingnumber1 == 100:
print("value is equal")
else:
print("value is big")
#Challenges 8
value1 = randint(2,50)
value2 = randint(2,50)
print("What is " + str(value1) + " times " + str(value2))
user_input2 = int(input(""))
if value1 * value2 == user_input2:
print("yes")
else:
print("no")
#Challenges 9
win1 = randint(1,10)
win2 = randint(11,20)
win3 = randint(21,30)
print("Repeat this three time")
winners = str(win1) + " " + str(win2) + " " + str(win3)
for winner in winners:
print(winner)
Loading…
Cancel
Save