0
Python Course SoloLearn- Simple calculator
guys, what is answer here? How should it look like? Do i need only to use sum or only to use fun or are there many options to answer correct? cheers,
4 Respostas
+ 2
Not enough details.. Python have 5+ courses. Which course you are about and what is full task there? Mention your try along with your doubt or understandings.. Must post your try...
+ 2
Think about that in the most cases you need:
- to receive input data (text/string), here two arguments
- prepare the data for next step, for example convert to numbers
- calculate the result,
- print this result.
+ 2
a input() is invalid statement. You must use assignment operator to store value of input. Input is accepted as string typed so you must also convert to integer for integer input. This can be done by as :
a = int( input() )
Value stored in variable a.
Same do for second input
b = int( input() )
sum calculations is perfect after that print result or show result by
print( sum )
That's finish the task..
Hope it helps..
+ 1
Sure!
Name of the course: Python Core
Name of the problem:Simple Calculator
"Write a program to take two integers as input and output their sum.
Sample Input:
2
8
Sample Output:
10
Remember, input() results in a string."
My trial:
a input()# your code goes here
b input()
sum = a + b
Test Case 1
Input
6
3
Your Output
File "/usercode/file0.py", line 1
a input()# your code goes here
^
SyntaxError: invalid syntax
Expected Output: 9