4) Write a python program to accept your name and city name and print with a proper comment.
Answers
Answered by
0
Code:
# Accepting the name
name = input("What is your name? ")
# Accepting the city name
city = input("Where do you live? ")
# Printing the information
print("Oh, so you are ", name, " who lives in ", city)
# OR Using format
# Format itself has 2 ways
# Way 1
print(f"Oh so you are {name} who lives in {city}")
# Way 2
print("Oh so you are {0} who lives in {1}".format(name, city))
"""
This is a multi line comment btw.
I'm a programmer, I know many languages ;)
"""
Similar questions