Activity 2.36
Source Code
import math
import random
def main():
print("Main Menu")
print("E1 - Example 1")
print("Q - Quit")
done = False
while not done:
choice = input("Choice: ")
if choice == "Q":
print("Quit!")
done = True
elif choice == "E1":
example1()
elif choice == "E2":
example2()
elif choice == "E3":
example3()
elif choice == "E4":
example4()
else:
print("Invalid Choice")
# define Example 1 Function
def example1():
print("Example 1")
# Search for World
# Search for Python
# define Example 2 Function
def example2():
print("Example 2")
# Search for over after index 12
# Search for over between 4 and 10
# define Example 3 Function
def example3():
print("Example 3")
def example4():
print("Example 4")
multiline = """This is a multiline string.
It can span multiple lines, making it very useful for holding large amounts of text.
You can also use it for formatted text:
- Item 1
- Item 2
- Item 3
Even line breaks are preserved. Isn't that cool?
"""
print(multiline)
# call to main function, do not delete!
main()
Last updated