Class and Objects

4 minutes
Share the link to this page
Copied
  Completed
You need to have access to the item to view this lesson.
One-time Fee
$49.99
List Price:  $69.99
You save:  $20
€42.77
List Price:  €59.88
You save:  €17.11
£37.08
List Price:  £51.91
You save:  £14.83
CA$68.96
List Price:  CA$96.55
You save:  CA$27.59
A$76.38
List Price:  A$106.94
You save:  A$30.56
S$64.32
List Price:  S$90.06
You save:  S$25.73
HK$390.06
List Price:  HK$546.11
You save:  HK$156.05
CHF 40.14
List Price:  CHF 56.21
You save:  CHF 16.06
NOK kr502.12
List Price:  NOK kr703
You save:  NOK kr200.88
DKK kr319.28
List Price:  DKK kr447.02
You save:  DKK kr127.73
NZ$85.06
List Price:  NZ$119.09
You save:  NZ$34.03
د.إ183.58
List Price:  د.إ257.03
You save:  د.إ73.45
৳6,085.49
List Price:  ৳8,520.17
You save:  ৳2,434.68
₹4,412.09
List Price:  ₹6,177.29
You save:  ₹1,765.19
RM211.14
List Price:  RM295.62
You save:  RM84.47
₦76,406.71
List Price:  ₦106,975.51
You save:  ₦30,568.80
₨14,191.25
List Price:  ₨19,868.89
You save:  ₨5,677.63
฿1,609.32
List Price:  ฿2,253.18
You save:  ฿643.86
₺2,062.31
List Price:  ₺2,887.40
You save:  ₺825.09
B$272.33
List Price:  B$381.29
You save:  B$108.95
R884.13
List Price:  R1,237.85
You save:  R353.72
Лв83.73
List Price:  Лв117.23
You save:  Лв33.50
₩69,495.77
List Price:  ₩97,299.65
You save:  ₩27,803.87
₪166.96
List Price:  ₪233.76
You save:  ₪66.79
₱2,844.65
List Price:  ₱3,982.74
You save:  ₱1,138.09
¥7,407.23
List Price:  ¥10,370.72
You save:  ¥2,963.48
MX$933.65
List Price:  MX$1,307.18
You save:  MX$373.53
QR182
List Price:  QR254.81
You save:  QR72.81
P719.51
List Price:  P1,007.37
You save:  P287.86
KSh6,458.70
List Price:  KSh9,042.70
You save:  KSh2,584
E£2,427.02
List Price:  E£3,398.02
You save:  E£971
ብር7,152.60
List Price:  ብር10,014.21
You save:  ብር2,861.61
Kz45,588.63
List Price:  Kz63,827.73
You save:  Kz18,239.10
CLP$48,602.27
List Price:  CLP$68,047.07
You save:  CLP$19,444.80
CN¥356.46
List Price:  CN¥499.08
You save:  CN¥142.61
RD$3,169.86
List Price:  RD$4,438.06
You save:  RD$1,268.20
DA6,491.87
List Price:  DA9,089.14
You save:  DA2,597.26
FJ$112.79
List Price:  FJ$157.92
You save:  FJ$45.12
Q383.64
List Price:  Q537.12
You save:  Q153.48
GY$10,460.92
List Price:  GY$14,646.12
You save:  GY$4,185.20
ISK kr6,124.77
List Price:  ISK kr8,575.17
You save:  ISK kr2,450.40
DH453.73
List Price:  DH635.26
You save:  DH181.53
L838.09
List Price:  L1,173.39
You save:  L335.30
ден2,640.43
List Price:  ден3,696.82
You save:  ден1,056.38
MOP$401.73
List Price:  MOP$562.45
You save:  MOP$160.72
N$886.82
List Price:  N$1,241.62
You save:  N$354.80
C$1,839.97
List Price:  C$2,576.11
You save:  C$736.13
रु7,047.30
List Price:  रु9,866.78
You save:  रु2,819.48
S/176.08
List Price:  S/246.53
You save:  S/70.45
K211.88
List Price:  K296.66
You save:  K84.77
SAR187.57
List Price:  SAR262.61
You save:  SAR75.04
ZK1,189.89
List Price:  ZK1,665.94
You save:  ZK476.05
L217.24
List Price:  L304.15
You save:  L86.91
Kč1,045.04
List Price:  Kč1,463.14
You save:  Kč418.09
Ft16,806.50
List Price:  Ft23,530.45
You save:  Ft6,723.94
SEK kr470.42
List Price:  SEK kr658.63
You save:  SEK kr188.20
ARS$68,111.66
List Price:  ARS$95,361.78
You save:  ARS$27,250.11
Bs345.64
List Price:  Bs483.93
You save:  Bs138.28
COP$199,687.37
List Price:  COP$279,578.30
You save:  COP$79,890.92
₡25,278.20
List Price:  ₡35,391.50
You save:  ₡10,113.30
L1,310.03
List Price:  L1,834.15
You save:  L524.12
₲360,426.55
List Price:  ₲504,626.01
You save:  ₲144,199.46
$U2,003.11
List Price:  $U2,804.51
You save:  $U801.40
zł181.94
List Price:  zł254.73
You save:  zł72.79
Already have an account? Log In

Transcript

Okay in this python programming we have this class and these objects. So we can create this class in Python using something like this. So this is our Hello module. So I can create a cross class message. Then I will have to create a new function add a new function. So let's see I put in text here.

I will create a class variable here first x equal empty. Okay, yeah, we'll sell Oh, x K. If I want to print this Hello, I want to create a class I can do something like this. The Fae, praying Hello. In class vo we will always need to put a self keyword or self inside this function. Okay. I can do something like this pre k Hello.

Okay. So that's okay. Let's see I want to create Oh, based on this cross I can do something like this. Okay. See I do mass equal Hello module message Okay then mass da, green Hello. Okay, hello dot message.

So, my init class here have a parameter here. So I have to put in some values. So I will put in on James Okay. Let's say I pray I run the code now. The idea is Hello James. Okay what is called to your school minister I in this untitled Python file, I created an object based on this message cross getting this message across I put in these gems here, Jane Smith value.

This James value will come to hear Okay and then you pour this value into this variable here. So it is a test variable will now have adisa Jas value and then when I call print hello it will print hello and the value here so you're printing Hello James case a print hello James ah let's see if I do not want to put in any values in these in it in here I can do away okay I can't bring in something like this okay then here I will have to put in a test case okay then I will print these So now Id creddies I create this object, I will not need to put in any values in the message here. I have to put in the values here. Click Run and then run the code. Again. Hello Jameson

Sign Up

Share

Share with friends, get 20% off
Invite your friends to LearnDesk learning marketplace. For each purchase they make, you get 20% off (upto $10) on your next purchase.