Making a contact management system. Please help | Sololearn: Learn to code for FREE!

+1

Making a contact management system. Please help

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. name = "James" age = "42"

8/7/2022 6:51:27 PM

Samuel Adesanya

8 Answers

New Answer

+6

Samuel Adesanya , Pavan Kuncham , it is simpler to use this notation instead of using `+` and concatenation. we don't need to handle additional spaces in the string. just use commas to separate the arguments inside print() function: print(name, "is", age, "years old")

+4

Please read the previous lesson again. Compare for example print("a+b") and print("a"+"b").

+3

What have you tried so far? Re-read the lessons and show your code attempt please.

+1

Lothar ok bro and thank you for extra information

0

The expected output is: James is 42 years old

0

I have read the lesson countless times and I've even gone through the comments below each lesson and I don't seem to be getting it, maybe I need a little help. This is my attempt below: name = "James" age = "42" print ("name+is+age+years+old")

0

name = "James" age = "42" Print(name+" is"+age+" years old")

0

print("name is "+name++" "+age+" years old")