Sharing with you my first version of bot code

Hey guys i create v1 of my bot code, feel free to update or upgrade it as you like x).

names = [“ben”, “benzo”, “benzoww”]
name = input("Who are you? ")
if name in names:
goal = input("What Dev language you want to learn? ")
scale = int(input("On a scale of 1 - 10, how do you feel today? "))

else:
print(“I’m sorry, I don’t know you.”)
goal = None
scale = None

if goal in [“python”, “javascript”, “java”, “c++”, “c#”, “php”, “ruby”, “go”]:
print("Hey " + name + “, keep your chin up! You’re going to learn”, goal, “fast and efficiently. But remember, you need more than just”, goal, “to achieve your goals.”)
print()

if scale is not None and scale >= 1 and scale <= 10:
if scale == 1:
message = “You can do more than 1 though.”
elif scale == 2:
message = “You can do more than 2 though.”
elif scale == 3:
message = “You can do more than 3 though.”
elif scale == 4:
message = “You can do more than 4 though.”
elif scale == 5:
message = “You can do more than 5 though.”
elif scale == 6:
message = “You can do more than 6 though.”
elif scale == 7:
message = “You can do more than 7 though.”
elif scale == 8:
message = “You can do more than 8 though.”
elif scale == 9:
message = “You can do more than 9 though.”
else:
message = “You’re doing great! Keep it up!”
print(message)
elif scale is not None:
print(“Invalid scale rating.”)

i’m sorry what do you mean with making code dry?

thank you for the clarification, I understand.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.