Python program accepts first & last name and prints them in reverse order with a space between them

Опубликовано: 25 Октябрь 2024
на канале: programmer aditya
391
3

Explanation:

This code prompts the user to input their first and last name, and then it prints a message that combines the first name and last name in a specific order.

The first line fname = input("Input your First Name : ") gets the user's first name using the input() function and assigns it to the variable 'fname'.
The second line lname = input("Input your Last Name : ") gets the user's last name using the input() function and assigns it to the variable 'lname'.
The third line print ("Hello " + lname + " " + fname) prints a message that combines the last name and first name, concatenating them with the + operator and separated by a space.
Flowchart: