Python Program - Type of Class Members
#SimpleSnipCode
Create a class called Numbers, which has a single class attribute called
MULTIPLIER, and a constructor which takes the parameters x and y (these should all be numbers).
i. Write a method called add which returns the sum of the attributes x and y.
ii. Write a class method called multiply, which takes a single number
parameter a and returns the product of a and MULTIPLIER.
iii. Write a static method called subtract, which takes two number parameters, b and c, and returns b - c.
iv. Write a method called value which returns a tuple containing the values of x and y. Make this method into a property, and write a setter and a deleter for
manipulating the values of x and y.
Code Link :- https://github.com/rahulzxcvbn/BScIT-Python-Practical/blob/main/7c.py
Видео Python Program - Type of Class Members автора Python: революция в кодировании
Видео Python Program - Type of Class Members автора Python: революция в кодировании
Информация
2 декабря 2023 г. 5:47:31
00:18:22
Похожие видео