 Simple Calculator Test | Sololearn: Learn to code for FREE!

+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

+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.

+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

+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

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?

0

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

0

Rellot, I'm sorry but that makes no sense to me. What input, from what user?

0

S A in the code coach, the computer simulate input to check the test cases

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.

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."

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

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

-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.