+ 1

Input = Prerna Goyal Output =PRerNA GOyaL

Please write program for this in python

29th Apr 2020, 6:06 AM
Prerna Goyal
Prerna Goyal - avatar
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)
29th Apr 2020, 10:39 AM
ANJALI SAHU
+ 1
Okay thank you so much â˜șâ˜ș
29th Apr 2020, 10:41 AM
Prerna Goyal
Prerna Goyal - avatar
+ 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
30th Apr 2020, 2:29 PM
Reca Resu
Reca Resu - avatar
0
Please Show us your attempt..
29th Apr 2020, 10:14 AM
ANJALI SAHU
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())
29th Apr 2020, 10:17 AM
Prerna Goyal
Prerna Goyal - avatar
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
29th Apr 2020, 10:17 AM
Prerna Goyal
Prerna Goyal - avatar
0
Is there any logic behind to capitalise which word??
29th Apr 2020, 10:19 AM
ANJALI SAHU
0
Except the word on position 2 nd 3 it will capabilities all the words in the string
29th Apr 2020, 10:20 AM
Prerna Goyal
Prerna Goyal - avatar
0
I wanted to know which words you wanted to capitalise??
29th Apr 2020, 10:21 AM
ANJALI SAHU
0
Suppose i have a string named with mhakhoshal okay then i want the output is MHakHOshAL
29th Apr 2020, 10:22 AM
Prerna Goyal
Prerna Goyal - avatar
0
Take help from this code...
29th Apr 2020, 10:40 AM
ANJALI SAHU
0
Prerna Goyal â˜șïžđŸ‘
29th Apr 2020, 10:42 AM
ANJALI SAHU