clubs:python_club:python_club_ex_reverse_name
Home | clubs :: cloud club :: python_club :: 3D-Printing | projects :: Proxmox | Kubernetes | scripting | utilities | games
Table of Contents
Python Club Topics - Exercise: Reverse name
Exercise: Reverse name
- Output: Display the user's name in reverse order with a comma between names
- What you learn from the example:
- Get input from a user
- Manipulate strings
Solution
[1] code:python show
# Prompt the user to input their first name and store it in the 'fname' variable
fname = input('Input your First Name : ')
# Prompt the user to input their last name and store it in the 'lname' variable
lname = input('Input your Last Name : ')
# Display a greeting message with the last name followed by the first name
print('Hello ' + lname + ', ' + fname)
Bonus round: Try reversing the letters of your name.
clubs/python_club/python_club_ex_reverse_name.txt · Last modified: by 127.0.0.1
