How to answer all test cases | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 3

How to answer all test cases

Hello I need help with 16.2 , well the first test case, I did, but there more case tests, my first code interrupt with the second test case 2. How I separate them. First case *** hello *** and second test *** python is awesome *** ...

5th May 2021, 9:29 AM
yuri kelner
yuri kelner - avatar
16 Answers
+ 6
You have to use input() It will be different for each test case
5th May 2021, 10:02 AM
Benjamin Jürgens
Benjamin Jürgens - avatar
+ 3
Hi yuri kelner Please review lesson 16.1 of "Python for Beginners" as it directly relates to the problem you are having. as Benjamin Jürgens has stated, input() will be helpful
5th May 2021, 10:18 AM
Rik Wittkopp
Rik Wittkopp - avatar
+ 1
yuri kelner If your code correct all test cases will be passed !
5th May 2021, 9:39 AM
Giriraj Yalpalwar
Giriraj Yalpalwar - avatar
+ 1
yuri kelner Well done! 😁👍
5th May 2021, 10:55 AM
Rik Wittkopp
Rik Wittkopp - avatar
+ 1
You need to write one code which will pass both the test cases. Test case 1 and test case 2 are sample inputs which means if you enter either hello or awesome you should be able to output *** hello*** or *** awesome***, whichever given as input. var = input() print("***" + var + "***") Input - hello Output - ***hello*** Hope this helps!
7th May 2021, 9:41 AM
Mandira Mukherjee
Mandira Mukherjee - avatar
+ 1
my first case is satisfied but when i m attempting the second case then first case becomes unsatisfied how can i do both the test case in transportation problem
10th Jul 2021, 6:51 AM
PRACHI SHARMA
PRACHI SHARMA - avatar
+ 1
string = input(" ") [::-1] print(string) ;
22nd Oct 2021, 5:04 AM
Kumaresan
+ 1
Hello sololeaners l need some assistance , completed my first test case when attempting the second case vanishes. name_1="hello" print("***"+name_1+"***") answer() name_2="awesome is python" print (("***" +name_2)*(1+valid_tax))
18th Nov 2023, 8:57 PM
Tison
Tison - avatar
0
Well, now you gotta think outside the box, try stuff, fail. Thats how you learn
5th May 2021, 9:55 AM
Slick
Slick - avatar
0
Thank you very much everyone!!!!❤️ I got it 🙂
5th May 2021, 10:54 AM
yuri kelner
yuri kelner - avatar
0
IN C++ ??? is input() or diferent
17th Aug 2021, 8:07 PM
Luis Alfredo Villamizar López
Luis Alfredo Villamizar López - avatar
0
Luis Alfredo Villamizar López cin >> variable There are a number of different formats. Create a separate question from this thread and post it, you should get a number of responses showing you how to do it.
17th Aug 2021, 9:11 PM
Rik Wittkopp
Rik Wittkopp - avatar
0
text= input("") print ("*** "+text+" ***")
23rd Sep 2022, 1:54 PM
cutie2heart
cutie2heart - avatar
0
Tison Please create a separate question with enough details for us to assist you ▪︎Language being used -> Python? ▪︎ Challenge details including expected output from input ▪︎ Show your attempt, preferably a link to your playground code attempt
19th Nov 2023, 12:45 AM
Rik Wittkopp
Rik Wittkopp - avatar
- 2
I don't know how to continue. The first case is correct, but second case is to write python is awesome. Name=(" hello ") Print("***" + name + "***")
5th May 2021, 9:53 AM
yuri kelner
yuri kelner - avatar
- 2
I solved the first and the second case separately, but still don't have idea, how to connect them. 3-4 hidden. name=(" hello ") name2=(" python is awesome ") Print ("***" + name2 + "***")
5th May 2021, 10:14 AM
yuri kelner
yuri kelner - avatar