Post Reply 
How does python work?
09-06-2021, 05:01 PM
Post: #3
RE: How does python work?
(09-06-2021 04:53 PM)Dougggg Wrote:  This will work

Code:
def func1(a, b):
return a + b

def func2(a, b):
return a - b

def func3(a, b, c):
if c == 0:
return func1(a, b)
else:
return func2(a, b)

d=func3(4,2,0)

Maybe, I didn't explain properly. I am not looking to run the code from the python app. I am looking to run the code from the place where you do regular calculations. For example, if I was using python-syntax under XCas, I would do the following:

PHP Code:
#cas
def func1(ab):
    return 
b

def func2
(ab):
    return 
b

def func3
(abc):
    if 
== 0:
        return 
func1(ab)
    else:
        return 
func2(ab
#end 

I'm looking to do the same but with python, not XCas.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
How does python work? - hamorabi - 09-06-2021, 04:37 PM
RE: How does python work? - Dougggg - 09-06-2021, 04:53 PM
RE: How does python work? - hamorabi - 09-06-2021 05:01 PM
RE: How does python work? - roadrunner - 09-06-2021, 08:15 PM
RE: How does python work? - hamorabi - 09-07-2021, 07:45 AM
RE: How does python work? - roadrunner - 09-07-2021, 12:06 PM
RE: How does python work? - hamorabi - 09-07-2021, 09:24 PM
RE: How does python work? - roadrunner - 09-07-2021, 10:05 PM
RE: How does python work? - hamorabi - 09-08-2021, 10:48 AM
RE: How does python work? - roadrunner - 09-08-2021, 11:08 AM



User(s) browsing this thread: 1 Guest(s)