write a python program which accepts the user 1

write a python program which accepts the user

firstName = input("Enter your first name : ") # ask for the user's first name
lastName = input("Enter your last name : ") # ask for the user's last name
print(f"Hello {lastName} {firstName}") # print the whole
# We here used a f-string which allows to put variables' value in a string
# by writing them between {}

Here is what the above code is Doing:
1. We ask the user to enter his first name and store it in a variable called firstName
2. We ask the user to enter his last name and store it in a variable called lastName
3. We print a string that contains the user’s first name and last name

Similar Posts