Python Forum
How to call self into other functions
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to call self into other functions
#1
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)
Reply
#2
Please use proper code tags while coding - see BBCode
pyzyx3qwerty
"The greatest glory in living lies not in never falling, but in rising every time we fall." - Nelson Mandela
Need help on the forum? Visit help @ python forum
For learning more and more about python, visit Python docs
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  syntax error, and call functions. Ayiden 3 4,117 Mar-23-2017, 03:32 PM
Last Post: sparkz_alot

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020