User Tools

Site Tools


clubs:python_club:python_club_ex_reverse_name
Home | clubs :: cloud club :: python_club :: 3D-Printing | projects :: Proxmox | Kubernetes | scripting | utilities | games

About the Club

Python Club Topics - Exercise: Reverse name

Exercise: Reverse name

  1. Output: Display the user's name in reverse order with a comma between names
  2. What you learn from the example:
    1. Get input from a user
    2. 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