p
y
c
h
a
l
l
e
n
g
e
r
Home
Intermediate Python
Classes and OOP I
Use a Class Attribute in a Method
Use a Class Attribute in a Method
A class attribute can be read from inside a method. Use the conversion rate to compute a result.
Premium
reset
def greet(name): return f"Hello, {name}!" print(greet("Erik"))
Python
Setting up Python environment...
Output