Classes, Methods, and Objects in python for beginners
Автор: Aryan Narwal
Загружено: 2022-07-28
Просмотров: 30
Welcome To Our channel
In this video learn everything about Classes, Methods, and Objects in python for beginners.
****************************code code code******************************
# make your own class
class printer:
# make your first method
def printer_namer(self):
return "Hello World"
# make your object
first_time = printer()
# access method of my object
print(first_time.printer_namer())
num1 = int(input("Enter first number: "))
num2 = int(input("Enter second number: "))
class calculator:
def __init__(self, num1, num2):
self.first_num = num1
self.second_num = num2
def add(self):
return self.first_num + self.second_num
cal1 = calculator(num1, num2)
# changing/manipulating object properties
cal1.first_num = 4
cal1.second_num = 5
# deleting object properties
# del cal1.first_num
# delete object
del cal1
print(cal1.add())
****************************code code code******************************
So consider Giving a video a like, share it with your friends and Subscribe to our channel too for more videos.
Instagram: / rohitnarwal7988
Python book for beginners and intermediate people: https://www.amazon.com/Python-simple-...
Python book for advance topics: https://www.amazon.com/Advance-Python...
Доступные форматы для скачивания:
Скачать видео mp4
-
Информация по загрузке: