Bottom Page

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)
Quote
#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
Quote

Top Page

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

Forum Jump:


Users browsing this thread: 1 Guest(s)