0
How can build a function which gives sth? Please give an example
7 Answers
+ 1
1. indention
indent once more all lines in your function
2. print(func(a, b))
+ 3
boy.... seeing a code working is endorphin at its best.
Dont miss that experience and hack the code into code playground!!!
Cant be wrong too much... right?
+ 1
def givesth():
return "giveSomething"
+ 1
Amir ...now its up to you
that homework is not too hard.
0
I mean a function that give two integers and check their values then add or multiply them
0
def func(x,y):
if (x*y)<=1000 :
return x*y
else:
return x+y
a = input("a num")
b = input ("a num")
func(a,b)
#what's its problem?
0
def func(x,y):
if (x*y)<=1000 :
return x*y
else:
return x+y
a = input("a num")
b = input ("a num")
print(func(a,b))
Is it correct now?