14 Antworten
+ 4
Show what you have tried and someone will guide you further.
+ 3
Nathan kapusa ,
there is some information missing:
? what is the tutorial name
? what is the modu name
? what is the lesson name
in general:
when an input is required in python, we need to use the input() function. like:
city = input()
> in playground, a pop-up window appears when this line of code is executed.
> place the desired value in the input area and press submit. this will store the input value in the variable ``city``.
> if more than one input is demanded, we have to use a separate line for each input value.
+ 2
I tried
address = ("user") because it cut me at the end of user that I can't type anymore
+ 2
The question was as follows
Complete the code to get a user input and store it into a variable called address
address =
+ 2
Answer,
Address="out of this world"
+ 2
Peniel Rufus, this will output user input.
I don't think that is the desired one.
+ 1
Just use the input() function
0
Nathan kapusa, you can use the input() function to take a string input from the user and store it in a variable.
address = input()
Here, the variable address is assigned the user input value.
0
The answer is
address = input()
Input is a builtin function to use in a different way than print()
0
Better use this command
address = Input(#your message you want to send to the user)
0
Simple, just use the input() function. E.g.
address = input ()
0
i just passed that level
the issue is there is space between input and the bracket
instead of address=input ()
use address=input()
0
Peniel Rufus, Python ignores the white spaces like these because it does not affect indentation. You just need to ensure correct spacing when a variable is defined and when it is called and when you are handling keywords, operations and functions.
For example:-
address = input ( )
works the same as–
address=input()
However, it is important to note that:
address = in put() will raise a SyntaxError.
address = input()
print(add ress)
will also raise an error because the variable 'add ress' has not been defined as it is not the same as 'address'.
0
user = input("address")
address = user