Skip to content
Sign upLog in
This post is read-only. Explore Repls and connect with other creators on Community.View Community
The info in this post might be out of date, check out our docs instead. View docs
2

Repeating in Python

aricmiller
aricmiller

Hello, world! I am currently working on a AI and I would like to repeat the code,

if UserInput == "hi": print(AI_Name + ": Hello!") elif UserInput == "who made you": print(AI_Name + ": I was made by Aric Miller") if UserInput == "who are you": print(AI_Name + ": I'm " + AI_Name + "! I can do lots of things.")

But I am not sure how to do that. Could you help me?
Thanks in advance!
-Aric Miller (

@aricmiller
)

2 years ago
You are viewing a single comment. View All
4
RYANTADIPARTHI
RYANTADIPARTHI

@aricmiller
here's the code. with no errors.

while True UserInput = str.lower(input("")) if UserInput == "hi": print(AI_Name + ": Hello!") elif UserInput == "who made you": print(AI_Name + ": I was made by Aric Miller") if UserInput == "who are you": print(AI_Name + ": I'm " + AI_Name + "! I can do lots of things.") if UserInput == "what time is it" or "what is the time" or "time": print(AI_Name + ": " + ".")
2 years ago