Add Them Up

Welcome to the Toph Community!

This line in your code, f,s,t=map(int,input().split(',')) is expecting three comma-separated values to be inputted.
But, according to the problem statement,

The input will contain two integers A and B.

This is why your code’s giving runtime error.
Besides that, your code isn’t actually meeting the I/O expectations. So you’ll probably get a wrong answer, too. I’d suggest you to reread the statement properly.

Happy Toph-ing!

1 Like

Take input like this:

a, b = map(int, input().split())

I have made a python code in python 3.9.5 but here is python 3.8 available… My first test copycat successfully submitted after some mistakes but my this code is showing syntax error but IDE( PyCharm) isn’t showing a single error… please check this out,

add_them_up

a = int(input(“”))
b = int(input(“”))

add_them_up = a + b

c = -200000000
d = 200000000

if c < a and b < d:
print(add_them_up)

else:
pass

@abir123 I am noticing a few issues. But the most important one is that the two numbers A and B appear on the same line in the input file (like A B, not A\nB). So the input code should look like this:

A, B = map(int, input().split())

Also, you don’t need to check if A and B are within constraints. You can assume that c < a and b < d in your code will always be true. So just remove them and print the summation.

OK, bro… thanks a lot :slight_smile:

1 Like
v = int(input())
a= int(input())
sum = v+a
print(sum)

WHATS WRONG

Input will be in one line separated by space not in two lines. Use map function like this
v,a=map(int,input().split())

1 Like

#include <stdio.h>

int main()
{
int A, B;

scanf("%d %d", &A, &B);

printf("%d", A+B);

}

whats wrong with this??

Welcome to the image Toph Community, @Mohammad_Ivan! :wave:t5:

Your code looks good, but you accidentally selected Bash as the language before submitting it. That’s why you got the Runtime Error verdict.

a = int(input())
b = int(input())
sum=a+b
print(sum)

what is problem this code???