Hi I need some help with this code, at the moment I am just trying to get the commandline function to work. It should when I type a command like help or exit react to it, however I have to type the command 3 times for it to work which is strange. I would like a fix for the code rather than an alternate method for what I would like for it to do but I would be happy to hear your solution. Many thanks.
# Speed/Time/Distance # Velocity/Lambda/Frequency # d = speed*time # v = frequency*wavelength class Formulator(object): def __init__(self): speed = 0 time = 0 distance = 0 velocity = 0 wavelength = 0 frequency = 0 unit = "undefined" def speeddistancetime(self): pass def speedlambdafrequency(self): pass def commandline(): command = input("Command: ") command.lower() return command def Help(): print("Formulae: Waves|Dimensional - cant think of a better name :s ") print("At least 2 variables are needed to calculate the missing value of the last variable.") print("To choose a formula you will need to type the name of it into the command line.") print("The missing variable will need to be entered afterwards.") print("You then need to enter the values of the other 2 variables.") print("Type exit to exit the program.") #Start up fo = Formulator() stop = False print("For information about commands, type help.") #Management while stop == False: commandline() print(commandline()) if stop == False: if commandline()== "exit": print("yep") stop = True if stop == False: if commandline()== "help": Help()