+ 1
Input = Prerna Goyal Output =PRerNA GOyaL
Please write program for this in python
12 Answers
+ 2
a=input("Enter string:")
l=a.split()
new=[]
for i in range(len(l)):
if i==0:
b=list(l[i])
for j in range(0,len(b),4):
b[j]=b[j].upper()
try:
b[j+1]=b[j+1].upper()
except:
pass
new.append("".join(b))
else:
b=list(l[i])
for j in range(2):
b[j]=b[j].upper()
new.append("".join(b))
print(*new)
+ 1
Okay thank you so much âșâș
+ 1
try firstly covering complete user input with upper() function
Then use the loop to convert into small letters
input [3]=input. lower ()
input [2]=input. lower()
remember using split function
0
Please Show us your attempt..
0
x="prerna"
l=len(x)
for i in range(l):
if((i%2==0) or (i%2==1)) & ((i!=2) &(i!=3)):
print(x[i].upper())
else:
if(i==2) or (i==3):
print(x[i].lower())
0
I have done it but i am not able to do it with any name string it only eorks for prerna goyal not for other
0
Is there any logic behind to capitalise which word??
0
Except the word on position 2 nd 3 it will capabilities all the words in the string
0
I wanted to know which words you wanted to capitalise??
0
Suppose i have a string named with mhakhoshal okay then i want the output is MHakHOshAL
0
Take help from this code...
0
Prerna Goyal âșïžđ