Hello, OnlineGDB Q&A section lets you put your programming query to fellow community users. Asking a solution for whole assignment is strictly not allowed. You may ask for help where you are stuck. Try to add as much information as possible so that fellow users can know about your problem statement easily.
Login
Login
OnlineGDB Q&A
Questions
Unanswered
Tags
Ask a Question
Ask a Question
function is cascading the number
+1
vote
asked
Aug 30, 2019
by
anonymous
def Su(q,b):
return q+b
print("Enter 2 numbers: ")
a=input()
c=input()
x=Su(a,c)
print("Sum is "+x)
answer:
sum is 13 if a=1 & c=3
function
sum
Please
log in
or register to answer this question.
1 Answer
0
votes
answered
Jan 17, 2024
by
Dzouna
(
180
points)
The values are being inputed as strings. Try cahnging them to integers or floats.
def Su(q,b):
return q+b
print("Enter 2 numbers: ")
a=int(input())
c=int(input())
x=Su(a,c)
print("Sum is "+ str(x))
Please
log in
or register to add a comment.
Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and receive answers from other members of the community.
...