Skip to content
Snippets Groups Projects
Commit 3e441015 authored by dhana surya's avatar dhana surya
Browse files

Loop through the char in the word and complete the snack case

parent 47409769
No related branches found
No related tags found
No related merge requests found
# TODO : prompt the usr name the varialable (camel_name )
camel_name = input("Enter the prompt of the camel case : ")
# TODO : instilise the empty string to build a snake case and name a variable (snake_case )
snake_case = ""
# TODO : Loop through the every characater in the camel_name :
# TODO :IF the char is in the uppercase before the char append (under score ) and conver the upper case into lower case
# TODO : print the variable snake_name
\ No newline at end of file
for letter in camel_name :
if letter.isupper():
snake_case += "_"
snake_case += letter.lower()
else :
snake_case += letter
# TODO : print the variable snake_name
print(f"The snake case of the letter is {snake_case}")
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment