Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

python getAttr

class Student:
  marks = 88
  name = 'Sheeran'

person = Student()

name = getattr(person, 'name')
print(name)

marks = getattr(person, 'marks')
print(marks)

# Output: Sheeran
#         88
Comment

PREVIOUS NEXT
Code Example
Python :: try except python not working 
Python :: how to get confusion matrix in python 
Python :: herencia python 
Python :: python pyqt5 
Python :: matplotlib show plot 
Python :: cumulative percentaile pandas 
Python :: matplotlib styles attr 
Python :: how to add two list by zip function in python 
Python :: tkinter button hide 
Python :: execute terminal command from python 
Python :: Calculate Euclidean Distance in Python 
Python :: python split paragraph 
Python :: python script as service linux 
Python :: how to create an empty list of certain length in python 
Python :: how to sum all the numbers in a list in python 
Python :: json decode py 
Python :: install a lower version of python using conda 
Python :: get_dummies 
Python :: python add to list 
Python :: findout not common values between two data frames 
Python :: dtype in pandas 
Python :: pandas column rank 
Python :: joining two lists in python 
Python :: pygame point at mouse 
Python :: disable close button in tkinter 
Python :: django production 
Python :: open csv from url python 
Python :: python convert hex number to decimal 
Python :: python argparse custom categories 
Python :: Fast api importing optional 
ADD CONTENT
Topic
Content
Source link
Name
7+1 =