+ 5
Can somebody pls solve this?
# Ask the user for input and store it in a variable name = # Display the user input on the screen
29 Respuestas
+ 13
# Ask the user for input and store it in a variable
name = input("Enter your name: ")
# Display the user input on the screen
print("You entered:", name)
+ 5
DO NOT write anything inside the parentheses of input(). Input is what the user enter – A user can enter different names. The app simulates user input when testing the code.
Carefully compare your code with the examples in the course. Does print() have "="? NO.
How do you print a variable's value?
print("name")
outputs "name".
But you are supposed to print the values stored in the variable.
Example:
result = 1
print(result)
vs.
print("result")
Compare your quotation marks to the ones given in the example codes.
+ 2
name = input() #asking for input by using the input function
print(name)
Keep learning
+ 2
Still not working:(
+ 2
You entered the code wrongly
name = input("Enter your name: ") NOT name = input(“Tom”)
print("You entered:", name) NOT print=(“name”)
+ 2
Finally solved!
Here we go:
name= input()
“Bob”
print(name)
Thanks everybody for the help!
+ 2
This is how it shoud be
# Ask the user for input and store it in a variable
name = input("Enter your name: ")
# Display the user input on the screen
print("Hello,", name)
+ 2
To ask the user for input, use input :
name=input()
#enter your name
Display user input on screen
Print(name)
Or
name=input("enter your name:")
Print(name)
+ 1
# Ask the user for input and store it in a variable
name = input(“Tom”)
# Display the user input on the screen
print=(“name”)
+ 1
# Ask the user for input and store it in a variable
name = input( 'Enter user name')
# Display the user input on the screen
print("You enter name here")
+ 1
# Ask the user for input and store it in
name = input("please enter your name: ")
# Display the user input on the screen
print(name)
+ 1
Print('Enter your name :')
x = input() Print (Hello, 1+x)
+ 1
Basically, you just need to ask the user to enter their name (or any input), store it in a variable, and then display it on the screen. So the user types something, the program saves it, and then shows it back.
+ 1
this should work:
name = input()
print ("name")
+ 1
name=input ("Enter your name:")
Print(name)
age=("Enter your age:")
Print(age)
+ 1
Well, your code in looking incomplete.
try this one-
# Ask the user for input and store it in a variable
name = input("Enter your name: ")
# Display the user input on the screen
print("You entered:", name)
Here input will ask you to input some value and print will show you the result.
I hope it will work.
+ 1
#include <iostream>
#include <string>
using namespace std;
int main() {
string name;
cout << "Enter your name: ";
cin >> name;
cout << "Your name is: " << name << endl;
return 0;
}
0
Hmm
0
Sure! Here is a python code :
x = input("Enter something : ")
print(" You entered :,x)
0
# Ask the user for input and store it in a variable
name = input()
# Display the user input on the screen
print(name)