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 :: vectorindexer pyspark 
Python :: bogo sort 
Python :: random ordered slice of an array 
Python :: <ipython-input-31-da456dc89cda in <module 
Python :: text to qr code python 
Python :: how to check if a dictionary is empty in python 
Python :: Reset Python Dictionary to 0 Zero. Empty existing Python Dictionary 
Python :: tkinter sin 
Python :: break outside loop python 
Python :: qcut and cut function in python stack overflow 
Python :: keep only min entries in dataframe grouped by one column 
Python :: how to create dll from java code 
Python :: ffff in decimal python 
Python :: perceptron multicouche scratch python 
Python :: train_ttest_split() 
Python :: Alembic not finding new models 
Python :: tanimoto coefficient rdkit 
Python :: list exaple in python 
Python :: pandas series add prefix 
Python :: nested list comprehensions 
Python :: how to change directory in python 
Python :: python vectorize 
Python :: python code for finding prime numbers 
Python :: break continue pass in python 
Python :: random forest classifier python 
Python :: compute confusion matrix using python 
Python :: __str__python 
Python :: python docstring use 
Python :: list slicing reverse python 
Python :: how to add items in list in python 
ADD CONTENT
Topic
Content
Source link
Name
1+1 =