+ 1

This code ran without errors, giving me an expected output. But it hasn't been passing sololearn popsicle challenge test cases.

https://code.sololearn.com/cC8mb6wz0jZp/?ref=app

10th Apr 2020, 9:45 AM
Mujeeb Adeyanju Sunmola
Mujeeb Adeyanju Sunmola - avatar
7 Antworten
+ 3
don't print extra message, just what they ask you to print: enc=input() dec="" for message in enc[::-1]: if message.isalpha() or message==" ": dec+=message print(dec)
10th Apr 2020, 9:50 AM
John Robotane
John Robotane - avatar
+ 3
Mirielle I did It was actually the "The Spy Life Challenge" I'm trying to solve for
10th Apr 2020, 9:54 AM
Mujeeb Adeyanju Sunmola
Mujeeb Adeyanju Sunmola - avatar
+ 3
John Robotane Thanks. I'll try your suggestion and get back to you.
10th Apr 2020, 9:54 AM
Mujeeb Adeyanju Sunmola
Mujeeb Adeyanju Sunmola - avatar
+ 2
John Robotane Perfect! Your suggestion works really fine Thanks man!
10th Apr 2020, 9:59 AM
Mujeeb Adeyanju Sunmola
Mujeeb Adeyanju Sunmola - avatar
+ 2
thank you too... you can update the question (replace Popsicle by The Spy Life)
10th Apr 2020, 10:10 AM
John Robotane
John Robotane - avatar
+ 1
import java.util.Scanner; public class Program { public static void main(String[] args) { Scanner input = new Scanner(System.in); int siblings = input.nextInt(); int popsicles = input.nextInt(); int temp = popsicles%2; if (siblings <= popsicles ){ if (temp == 0) { System.out.println("give away"); } else { System.out.println("eat them yourself"); } } if (siblings > popsicles ){ if (siblings % popsicles == 0) { System.out.println("give away"); } else { System.out.println("eat them yourself"); } } } }
24th Apr 2020, 3:15 PM
Mohan .R.A
Mohan .R.A - avatar