Computer Science, asked by pathakshobha300033, 10 months ago

Write a program that will ask the user to enter his/her name. Convert all uppercase letters to lowercase letters and vice - versa.

Answers

Answered by AbhijithPrakash
4

# First start by asking the user the name.

Name = input("Enter your name : ") # I chose a variable named "Name".

#Now as we have the name, we can play with it (I mean we can complete the program)!

nAME = '' # Let's take a variable named "nAME" that will contain the solution in the future.

 

for a in Name:  

# Checking for lowercase letter and converting to uppercase.  

   if (a.isupper()) == True:  

       nAME+=(a.lower())  

# Checking for uppercase letter and converting to lowercase.  

   elif (a.islower()) == True:  

       nAME+=(a.upper())

# Till now the value of nAME will have your solution.

print("Your new name is ", nAME)  

Attachments:
Similar questions