dde272c4b8
i18n - Build Validation / Validate i18n Builds (24) (push) Has been cancelled
CI - Node.js / Lint (24) (push) Has been cancelled
CI - Node.js / Build (24) (push) Has been cancelled
CI - Node.js / Test (24) (push) Has been cancelled
CI - Node.js / Test - Upcoming Changes (24) (push) Has been cancelled
CI - Node.js / Test - i18n (italian, 24) (push) Has been cancelled
CI - Node.js / Test - i18n (portuguese, 24) (push) Has been cancelled
CD - Docker - GHCR Images / Build and Push Images (push) Has been cancelled
1.2 KiB
1.2 KiB
id, title, challengeType, videoId, dashedName
| id | title | challengeType | videoId | dashedName |
|---|---|---|---|---|
| 697fe3cb32baa3841ab62a63 | Object Functions | 11 | 3Mla2uUDSu8 | object-functions |
--description--
In this video, you will learn how to work with functions inside of classes.
--questions--
--text--
Which of the following is the correct way to create a function inside of a class?
--answers--
class Student:
def __init__(self, name, age):
self.name = name
self.age = age
def greet(self.function):
return f"Hello, my name is {self.name} and I am {self.age} years old."
class Student:
def __init__(self, name, age):
self.name = name
self.age = age
def greet(self):
return f"Hello, my name is {self.name} and I am {self.age} years old."
class Student:
def __init__(self, name, age):
self.name = name
self.age = age
def greet(self):
self.pass
class Student:
def __init__(self, name, age):
self.name = name
self.age = age
greet = (self):
return f"Hello, my name is {self.name} and I am {self.age} years old."
--video-solution--
2