Skip to content

Instantly share code, notes, and snippets.

@samister2k
Created January 17, 2018 10:45
Show Gist options
  • Save samister2k/0095055ebe702170407ccf972fcaaf4c to your computer and use it in GitHub Desktop.
Save samister2k/0095055ebe702170407ccf972fcaaf4c to your computer and use it in GitHub Desktop.
from time import sleep
print("This is my revison for python")
print("Theres a list of code that i will be using and telling you what it does")
sam = ["print", "sleep", "input", "while loop", "If else", "functions", "list", "for loop"]
print("sam")
while True:
choice=input("pick from the list")
if choice=="print":
print("The print() function prints the given object to the standard output device (screen) or to the text stream file.")
sleep(1)
elif choice=="sleep":
print("Python's time module has a handy function called sleep(). Essentially, as the name implies, it pauses your Python program.")
sleep(1)
elif choice=="input":
print("If the input function is called, the program flow will be stopped until the user has given an input and has ended the input with the return key.")
sleep(1)
elif choice=="while True":
print("While loops, are used for repeating a section of code until the defined condition is met.")
sleep(1)
elif choice=="if else":
print("he else statement is an optional statement and there could be at most only one else statement following if.")
sleep(1)
elif choice=="functions":
print("You use functions in programming to bundle a set of instructions that you want to use repeatedly")
sleep(1)
elif choice=="list":
print("The list is a most versatile datatype available")
sleep(1)
elif choice=="for loop":
print("n computer science, a for-loop (or simply for loop) is a control flow statement for specifying iteration, which allows code to be executed repeatedly.")
sleep(1)
else:
print("not part of the list")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment