Answer:
Following are the code to this question:
value=input("Enter string value: ")#defining string variable for input value from user
val= ""#defining another string variable val
i=0#defining integer variable and assign value 0
for x in value:#defining loop for proving spacing in value
if x.isupper() and i > 0:#defining if block to check value upper and greatern then 0
val+= " "#proving spacing in string value
val += x.lower()#convert another value into lower case
else:#defining else block
val += x#hold value in val variable
i += 1#increment i variable value
print (val)#print value
Output:
Enter string value: StopAndSmellTheRoses
Stop and smell the roses
Step-by-step explanation:
In the above python code, a string variable "value" is defined that inputs the value from the user end, and another variable "val" is defined for saving calculated value.
In the next step, for loop is declared, that uses if block to check input value and convert the input value first letter into uppercase and print all value with space. If the condition is false it will return the user input value.