0
I'm stuck on a question this is python beginner course
You’re making a contact management system. The given program declares two variables, name and age. Complete the code to output "name is age years old", where name and age are the declared variable values.
27 Réponses
+ 6
Is there anything wrong with adding the spaces inside of the single quotes? The result is correct, but is this a bad way to practice it?
name = "James"
age = "42"
print (name + ' is ' + age + ' years old ')
+ 4
Finally I make it..... auuuhhhh
print(name, "is", age, "years old")
Wish u luck!!
+ 3
name = "James"
age = "42"
print(f'{name} is {age} years old')
+ 2
name, age = "James", "42"
print(f"{name} is {age} years old")
+ 1
me too, i am also stuck on this question as I have done so many ways but the output does not show space between words..I have tried in many ways such as:
Name = "James"
Age = "42"
print(name + "is" + age + "years old")
the output become nameisageyears old 😅...
does anyone help me to pointing which code or bug I have made mistake. Thank you.
+ 1
Have you find solution i’m also stuck on it
+ 1
name="James"
age="42"
print("name=James,age=42")
0
name = "James"
age = "42"
print("name" is "age" years old)
0
print(name + “ is ” + age + “ years old”)
Remeber the spaces
0
Thanks
0
name = "James"
age = "42"
print (name+' is '+age+' years old ')
0
name = input("James")
age = int("42")
print(name + "is", age, "years old")
0
name="vamshikrishna"
age="18"
print(name +"is" + age + "years old")
0
name = input("Name: ")
age = input("Age: ")
print(f"{name} is {age} years old")
0
Hello DANIEL. Keep in mind that Age and age are two different variables, the same goes for Name and name. And for the other problem you can just put a space after is (before ending the string) and before years old (this time after the first quotation). So it would look something like this:
name='arvin'
age='100'
print(name + ' is ' + age + ' years old')
0
name = input("James")
age = int("42")
print(name + "is", age, "years old")
0
The answer is
Print(name,’is’,age,’years old’)
0
print(name + 'is' + age + 'years old ')
0
name = "James"
age = "42"
print(" " + name + " is "+ age +" years old")
0
print (name + " "+"is" + " "+ age +" "+ "years old")