Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
how to get variable
#1
how do I get the variable holding the data

something like this
class Student:
    def __init__(self, name):
        self.name = name
    def display(self):
        print(f'Hello! My name is: {self.name}')
    def get_var(self):
        # code that will return the variable "tim"

tim = Student('tim')
Reply


Messages In This Thread
how to get variable - by Azdaghost - Apr-22-2025, 06:55 PM
RE: how to get variable - by deanhystad - Apr-22-2025, 08:29 PM
RE: how to get variable - by Azdaghost - Apr-23-2025, 07:09 PM
RE: how to get variable - by deanhystad - Apr-23-2025, 07:43 PM

Forum Jump:

User Panel Messages

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