Python Forum

Full Version: How to call self into other functions
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
This is the code I have, I'm not sure how i can execute add() by inputing the value of c through the call function.
Thanks!


class Drax:


def call(self,c):
self.c = c
print (f"{self.c} is my call")

def add(c,a,b):
d = a + b
print (f"I like the call {c} {d} times")

pika = call("mew")
add(5,7)
Please use proper code tags while coding - see BBCode