+ 1

The program must be print SoloLearn as the output. Note- S and L are in upper case. Can anyone send me the code...???

17th Jul 2020, 4:04 AM
Husnain Ansari
Husnain Ansari - avatar
23 Réponses
+ 4
Long but different from others Have a look https://code.sololearn.com/cH4GIcW0ArR8/?ref=app
17th Jul 2020, 4:25 AM
Arctic Fox
Arctic Fox - avatar
+ 7
This is a version that uses slices and title() method of strings: inp = 'sololearn' print(inp[:4].title()+inp[4:].title()) Its a kind of hard-coded, but anyway... That's how the description is. Task could also be like this: inp = ['solo','learn'] print(''.join([i.title() for i in inp]))
17th Jul 2020, 10:58 AM
Lothar
Lothar - avatar
+ 3
Here is your fix according to what you are trying to do in your code👇 https://code.sololearn.com/cPou1I21y0G7/?ref=app and here is what you want to do *According to question* and this is what me and Ćheyat said👇 https://code.sololearn.com/cu630E1tBNn2/?ref=app
17th Jul 2020, 4:22 AM
Arsenic
Arsenic - avatar
+ 2
Print("SoloLearn")
17th Jul 2020, 4:05 AM
Arsenic
Arsenic - avatar
+ 2
//print("SoloLearn") //puts "SoloLearn" //System.out.print("SoloLearn"); //std::cout << "SoloLearn"; //printf("SoloLearn"); //console.log("SoloLearn"); //<h1>SoloLearn</h1> //Console.Write("SoloLearn"); //echo "SoloLearn"; //? "SoloLearn" //PRINT "SoloLearn" //Writeln "SoloLearn" // NSLog(@"SoloLearn"); print("Show your code"); -Extended from Arsenic
17th Jul 2020, 4:08 AM
Saphal Poudyal
Saphal Poudyal - avatar
+ 2
Husnain Ansari ,Send you code here.
17th Jul 2020, 4:18 AM
Arsenic
Arsenic - avatar
+ 2
Could you please refer the link to your code please.
17th Jul 2020, 4:25 AM
Saphal Poudyal
Saphal Poudyal - avatar
+ 2
a,l_count = list("sololearn"),0 for i in range(len(a)): if(a[i]=="s" or (a[i]=="l" and l_count ==1)): a[i] = a[i].upper() elif a[i]=="l": l_count+=1 print ("".join(a))
18th Jul 2020, 4:28 PM
Bot
Bot - avatar
+ 1
It's weird that you profile says you have completed courses of 3 programming languages , but still you are not able to print a simple text on the console.
17th Jul 2020, 4:20 AM
Arsenic
Arsenic - avatar
0
Error: expected declaration specifiers
17th Jul 2020, 4:07 AM
Husnain Ansari
Husnain Ansari - avatar
0
It's showing again error like expected declaration specifiers or before string constant...
17th Jul 2020, 4:13 AM
Husnain Ansari
Husnain Ansari - avatar
0
Husnain Ansari What? Clarify Please!
17th Jul 2020, 4:18 AM
Saphal Poudyal
Saphal Poudyal - avatar
0
String='SkillRack' Print(string.upper)
17th Jul 2020, 4:20 AM
Husnain Ansari
Husnain Ansari - avatar
0
I already tried... what you sent me...
17th Jul 2020, 4:24 AM
Husnain Ansari
Husnain Ansari - avatar
0
We just want S and L are in capital letter not all string...
17th Jul 2020, 4:25 AM
Husnain Ansari
Husnain Ansari - avatar
0
Then use ꧁༒Rishabh༒꧂ 's example
17th Jul 2020, 4:25 AM
Saphal Poudyal
Saphal Poudyal - avatar
0
Code is executed in console but in skillrack are showing error??
17th Jul 2020, 6:41 AM
Husnain Ansari
Husnain Ansari - avatar
0
print("SoloLearn") there
17th Jul 2020, 11:59 AM
Gurseerit Singh Chahal ✓
Gurseerit Singh Chahal ✓ - avatar
0
print("SoloLearn")
18th Jul 2020, 2:20 PM
Aman Saini
Aman Saini - avatar
0
msg = "solo learn" msg = msg.title() msg = msg.replace(" ","") print(msg) Tested ✔
14th Aug 2020, 10:35 PM
Gurseerit Singh Chahal ✓
Gurseerit Singh Chahal ✓ - avatar