Answer to Question #178323 in Python for nun

Question #178323

Write codes that ask the user to write the name in lowercase. If they did not write in lowercase, keep asking them to re-enter the name until they write in lowercase. If they followed as instructed, then print the statement “Entered name is in lowercase”


1
Expert's answer
2021-04-05T23:24:44-0400
isLowercase=False
while isLowercase==False:
    #ask the user to write the name in lowercase.
    name = input("Enter the name in lowercase: ")
    lowercaseLetters = ''.join(c for c in name if c.islower())
    isLowercase=(len(name)==len(lowercaseLetters))
    #If they did not write in lowercase, keep asking them to re-enter the
    #name until they write in lowercase.
    if isLowercase==False:
        print("Entered name is not in lowercase. Re-enter the name.")
#print the statement “Entered name is in lowercase”
print("Entered name is in lowercase")

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS