0
Is there a simple function I can use instead of re.sub or re.split? (Thank you)
import re camel_case_string = input("camleCase") result = re.sub(r'(?<=[a-z])(?=[A-Z])', "_", camel_case_string).lower() print(result)
7 Respuestas
+ 2
Oslein ,
If you want help, help the people who help, and supply as much information as possible.
You forgot:
Python
You forgot:
Code Coach
Camel to Snake
Never use this in any Code Coach:
input("some prompt text")
The prompt text gets printed. Only print the text that the requirements ask for.
Yes, there are many other ways to solve that than re, such as looping through the input string to get each character and building an output string as you go, then printing the output string when your loop is done.
+ 2
yes
+ 1
tag the relevant programming language, not "hhhhhh"
+ 1
str1 = input()
for c in str1:
print(c)
+ 1
Thank you very much I never thought about that
0
Thank you but is it possible to loop through letters
0
Can you tell me for example give me a simple example om how I should assign a variable to the letters