Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

jsfakjfkjadjfksajfa

import random
import keyboard
import time
print("Welcome to Text Adventures!")
time.sleep(1)
print("Press up arrow key to start the game and down arrow key for credits.")
check = True
while check == True:
    if keyboard.is_pressed("up"):
        check == False
        break
    elif keyboard.is_pressed("down"):
        print("Credits:")
        print("Ilikepie928 [Scripter]")
playing_game = True
def print_m(talk,wait):
    print(talk)
    time.sleep(wait)
print_m("Ur just a broke college student starting a new life.",1)
print_m("You remembered you had an exam toomorow.",1)
user_choice = str(input("Do you want to go to the exam?(y/n)
"))
GotoExam = "n/a"
if "y" in user_choice:
    GotoExam = str("true")
else:
    GotoExam = str("false")
time.sleep(1)
if GotoExam == "true":
    print_m("It is a beautiful morning outside, you woke up getting ready for school.",1)
    print_m("You arrived on school just in time for your exam.",1)
    print_m("Teacher: Class get ready for your last term exam! If you pass this exam you are going to graduate from college.",1)
    totalscore = int(0)
    i = int(0)
    for i in range (1,11):
        random_number1 = int(random.randint(3,15))
        random_number2 = int(random.randint(3,15))
        user_ans = int(input(f"{i}.) {random_number1} + {random_number2} ="))
        if user_ans == random_number1 + random_number2:
            totalscore = int(totalscore + 1)
        else:
            pass
    print(f"{totalscore}/10")
Comment

PREVIOUS NEXT
Code Example
Python :: Express + Jade : Ensuring url paths are correct via controllers, orphaned links 
Python :: how to make a typing effect in python 
Python :: imprimir variables en python 
Python :: find middle permutation of the string in python list 
Python :: dataframe missing and zero values 
Python :: python without creating pyc 
Python :: Best websites to learn Python 
Python :: clock replacement algorithm python 
Python :: ring Insert Items in list 
Python :: difflib get close matches 
Python :: hacer un programa en python ingresar números enteros obtenga el segundo valor máximo 
Python :: ring Trace library usage to pass an error 
Python :: open urls using python grepper 
Python :: matplotlib plot dpi - change format to svg 
Python :: Start of my python career 
Python :: python covert vtt subtittle to text txt file 
Python :: Python 2.7 to 3.x Linux 
Python :: how to split string into list conditionally+python 
Python :: FinnT730 
Python :: pls help i need tkintwr help plspslspslspsl help tkinter 
Python :: python syntax error jedi 
Python :: python loop over lists 
Python :: remove stopwords python 
Python :: blakyubeuiwbciwcqiby7ib.py 
Python :: pass parameters to a odoo wizard 
Python :: discard method in python 
Python :: what is quit block in python 
Python :: backslashing in an interactive session in python 
Python :: Reverse Bits Algo 
Python :: threading pass keyword args example 
ADD CONTENT
Topic
Content
Source link
Name
8+5 =