File tree 1 file changed +35
-1
lines changed
1 file changed +35
-1
lines changed Original file line number Diff line number Diff line change 4
4
"cell_type" : " markdown" ,
5
5
"metadata" : {},
6
6
"source" : [
7
- " # Function & Class"
7
+ " # More structureeFunction & Class"
8
8
]
9
9
},
10
10
{
532
532
" \"\"\"\n " ,
533
533
" a car class\n " ,
534
534
" \"\"\"\n " ,
535
+ " # __init__ is initializing function\n " ,
536
+ " # it's called, when you run a = car(150)\n " ,
537
+ " # 150 is the parameter passed as arg speed_limit\n " ,
535
538
" self.seat_belt_on = False\n " ,
536
539
" self.speed = 0\n " ,
537
540
" self.speed_limit = speed_limit\n " ,
767
770
" car1.brake()"
768
771
]
769
772
},
773
+ {
774
+ "cell_type" : " markdown" ,
775
+ "metadata" : {},
776
+ "source" : [
777
+ " car is a class, car1 is an obeject of class car."
778
+ ]
779
+ },
780
+ {
781
+ "cell_type" : " code" ,
782
+ "execution_count" : 87 ,
783
+ "metadata" : {},
784
+ "outputs" : [
785
+ {
786
+ "name" : " stdout" ,
787
+ "output_type" : " stream" ,
788
+ "text" : [
789
+ " <class '__main__.car'>\n "
790
+ ]
791
+ }
792
+ ],
793
+ "source" : [
794
+ " print(type(car1))"
795
+ ]
796
+ },
797
+ {
798
+ "cell_type" : " markdown" ,
799
+ "metadata" : {},
800
+ "source" : [
801
+ " This intuitive way of programing an object is called objective oriented programing(oop), small wonder oop is heavily used in gaming industry"
802
+ ]
803
+ },
770
804
{
771
805
"cell_type" : " code" ,
772
806
"execution_count" : null ,
You can’t perform that action at this time.
0 commit comments