Simple Calculator Test | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

Simple Calculator Test

I've failed this 12 times. I can code it, get both answers, test 1 and 2. They also don't tell you which numbers to use, so you have to fail to discover the answers are 9 and 11. I don't understand how to separate both blocks of code to get two separate answers. I can pass both tests separately but not together. What am I doing wrong? I'm about to rage quit

11th Jul 2021, 4:54 PM
S A
13 Answers
+ 2
I understand your confusion. You can write A = input() in the code as if you actually wanted to give input yourself. When you submit your code to sololearn (when it runs the test cases), sololearn acts as if it was a real user and inserts a number.
11th Jul 2021, 5:42 PM
Lisa
Lisa - avatar
+ 1
S A take the input from the user. most code coaches require you to have input. maybe you need to revisit the python course if you don't know about taking user input
11th Jul 2021, 5:00 PM
Rellot's screwdriver
Rellot's screwdriver - avatar
+ 1
I appreciate you so very much Lisa! The question makes it seem like you must enter numbers, then when you get it wrong and it presents numbers, I kept doing it over and over again with those numbers. Thank you for taking the time to look into my question
11th Jul 2021, 5:46 PM
S A
0
A="6" B="3" Print(int(a)+int(b)) Answer is 9 X="11" Y="22" Print(int(x)+int(y)) Answer is 33 How do you separate them to pass BOTH tests at the same time?
11th Jul 2021, 4:57 PM
S A
0
Hi, can you please link your code here? Also please tag the relevant programming language.
11th Jul 2021, 4:58 PM
Lisa
Lisa - avatar
0
Hello Lisa, I don't know how to link code? So I typed it out. It's also Python, the very first lessons on this app
11th Jul 2021, 5:00 PM
S A
0
Rellot, I'm sorry but that makes no sense to me. What input, from what user?
11th Jul 2021, 5:02 PM
S A
0
S A in the code coach, the computer simulate input to check the test cases
11th Jul 2021, 5:03 PM
Lisa
Lisa - avatar
0
I have no idea what your talking about. I'm now more confused than I started. What is code coach? Maybe I'm not being clear. I'm on the first modular of Python Core, second lesson of Strings and Variables, the test at the end of lesson.
11th Jul 2021, 5:08 PM
S A
0
It's called Simple Calculator and instructs me to do the following "Write a program to take two integers as input and output their sum."
11th Jul 2021, 5:10 PM
S A
0
It doesn't tell you which numbers to use. So you must fail to discover it's 9 and 33. Using the numbers 6 and 3 in the first problem and 11 and 22 in the second problem
11th Jul 2021, 5:11 PM
S A
0
I can do the code to get the answers. How do I BOTH codes in the same box to get the correct answer for test 1 and 2, how do you separate two problems? I've used input() I've used """, none of it makes sense
11th Jul 2021, 5:12 PM
S A
- 3
"It doesn't tell you which numbers to use" and that's why I suggested to take user input. for eg-: A = input() or maybe you need to learn more. or coding isn't for you.
11th Jul 2021, 5:14 PM
Rellot's screwdriver
Rellot's screwdriver - avatar