-1
def work(here):
variabel = "Hi"
x1.here(variabel)

How can I make here as a local parameter? that will work for calling other functions?

Edited by ekkanh: n/a

3
Contributors
9
Replies
10
Views
6 Years
Discussion Span
Last Post by pyTony
0

You just use it by its name, like

def work(here):print(here)
work("Hi!")

Edited by pyTony: n/a

0

ok but if I for example want it to be able to take the value of the other functions:

def work(here):print(here)
    here("yes")
    here("why")
def okej(ok):
    print(ok)
def so(what)
    print(what)
    
work("this")
0
def work(here):
k1.here("hi")
k2.here("why")

class okej(self,good):
       def method(self,yes):
       def other(self,yes):

k1 = okej()
k2 = okej()

work(method)
work(other)

This is actually what I want to do! I want the word here to be able to be different names of methods, so I can call them from the function

Edited by ekkanh: n/a

0

Very bad style, but you could get it to work by passing method, not global function ie okej.method.

0

I dont understand what you mean now. My function is actually an option menu. How could I else solve this?

Edited by ekkanh: n/a

0

Looks like you have not clear object for train, which could contain the places for each date and time.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.