Dyskusje Q&A
Why does an error pop up here:
var1 = "Trey"
var2 = "Tanner"
var3 = "Ellis"
var4 = "Jake"
var5 = "Christine"
question = input('What is your name? ')
if question == "var1":
   print('Welcome Back Trey')
    
Error:
Traceback (most recent call last):
  File "Hi.py", line 6, in <module>
    question = input('What is your name? ')
  File "<string>", line 1, in <module>
NameError: name 'Trey' is not defined
 0 głosów
 10 odpowiedzican someone tell me how to make it impossible for a user to type a 'userchoice1[x]' value that does not range from 1 - 10. 
If you also know a way I can make   the user input another value for the  'userchoice1[x]' variable if it is less than 1, I'll appreciate you share the knowledge with me.
please see the short code below
 1 Głos
 2 odpowiedziIn the short code below, I declared an array of five elements. But I'm getting confused on how to use it in a while loop. My main question is , if the user inputs a userchoice1 value that is less than 1, I want the code to keep looping until the user inputs a number that is not less than 1. But I don't know if the 7th line (userchoice1 [x]++) shows the right way to loop it.
 1 Głos
 2 odpowiedziPopularne dzisiaj
How create a new language ?
 1 Votes
Beginner question
 0 Votes
I need help to solve this
 0 Votes
Remove
 0 Votes
Project
 0 Votes