5 Antworten
+ 4
Like 1 hour to learn syntax is more than enough. But to learn when to use it, how to use it properly (python OOP is famously terrible) would be a much longer journey?
Why do u need OOP in python though?
+ 1
You can learn OOP syntax in only 30 minutes, but for training, you should write small projects and codes and 1 hour per day is enough.
0
learning is different from being proficient. understanding the basics is easy, knowing when and how to use it properly takes a lot of time and practice.
Python OOP is a very simplified version. It's useful enough, though, for games, gui design, etc.
if you're trying to learn OOP with all the bells and whistles, learn Java.
0
I cant even figure out what OOP in python is & i just read an entire article on it
0
Romeo Beltran
Think of OOP as a grouping of variables and functions...
instead of separate unrelated variables and functions:
name = "Ben"
age = 10
def student_data(n, a):
print(n, 'is', a, 'years old')
student_data(name, age)
in OOP you group the data and the function into a single unit
class Student:
def __init__(self, n, a):
self.name = n
self.age = a
def student_data(self):
print(self.name, 'is', self.age, 'years old')
# then you use the class Student like this:
s1 = Student('Mickey', 17)
s1.student_data()
s2 = Student('Rick', 16)
s2.student_data()