I wanted to make a simple program that asks the user to enter a name, then asks whether to text, call etc that person, obviously it doesn't actually do those things but thought I'd give it a go. I want to make a help section, so when the user enter the word 'help' it displays all the available commands but I want the user to be able to enter their command again, after they have seen what commands are possible, if that makes sense. I'll copy the code here for a bit of context, please don't judge my probably very inefficient code:
import time
firstname = input("what is the first name? ")
lastname = input("what is the last name? ")
action = input("what would you like to do? (type 'help' for commands) ")
while action != "call" or "text" or "video call":
if action == "help":
print("you typed 'help'. here is the command list:")
print("text - text the person")
print("call - call the person")
print("video call - video call the person")
if action == "call":
print("calling ", firstname, lastname, ".")
time.sleep(1)
print("calling...")
time.sleep(1)
print("calling...")
time.sleep(1)
print("calling...")
time.sleep(1)
print("call connected!")
if action == "text":
textmessage = input("what is your message?")
print("are you sure you want to send '", textmessage, "' ?")
s = input()
if s == "yes" or "":
print("Ok, sending now.")
time.sleep(2)
print("Text sent.")
I tried using a while loop but that ended up just printing the 'help' information infinitely.