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.

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

1 Answer

0 votes
answered Jan 17 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))
Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and and receive answers from other members of the community.
...