So, I have a function that makes random integers and puts a operator between 2 of them so my friend can math. I wanted there to be multiple functions that could be called via a while loop after each interaction. I needed a way to actually select the functions and call them. I started with 1 function, and I put my code at the bottom of the function definition.
So I thought it would pop up and ask me what thing I want to load. But nothing happened. No errors, no “program ended”, nothing. Anyways, here’s my code:
from random import randint
loop = 1
while loop < 2:
def MathOnYourOwn():
opChoose = int(input("Choose an operator: type 1 for addition, 2 for subtraction, 3 for multiplication, 4 for division. "))
Math1 = randint(1, 9999999999999999999999999999999999)
Math2 = randint(1, 9999999999999999999999999999999999)
if opChoose == 1:
print(f"{Math1} plus {Math2}.")
if opChoose == 2:
print(f"{Math1} minus {Math2}.")
if opChoose == 3:
print(f"{Math1} times {Math2}.")
if opChoose == 4:
print(f"{Math1} divided by {Math2}.")
funcChoose = input("Which area do you want to load? Math... ")
if funcChoose == "Math.":
print(MathOnYourOwn())
def MeanMedianModeECT():
print("hi")
Code running but nothing happening.