Tuples

3 minutes
Share the link to this page
Copied
  Completed
You need to have access to the item to view this lesson.
One-time Fee
$99.99
List Price:  $139.99
You save:  $40
€86.14
List Price:  €120.60
You save:  €34.46
£75.77
List Price:  £106.09
You save:  £30.31
CA$140.05
List Price:  CA$196.08
You save:  CA$56.02
A$152.75
List Price:  A$213.86
You save:  A$61.10
S$129.79
List Price:  S$181.71
You save:  S$51.92
HK$778.59
List Price:  HK$1,090.06
You save:  HK$311.47
CHF 80.48
List Price:  CHF 112.68
You save:  CHF 32.19
NOK kr1,015.54
List Price:  NOK kr1,421.80
You save:  NOK kr406.25
DKK kr643.39
List Price:  DKK kr900.77
You save:  DKK kr257.38
NZ$175
List Price:  NZ$245.02
You save:  NZ$70.01
د.إ367.21
List Price:  د.إ514.11
You save:  د.إ146.90
৳12,228.73
List Price:  ৳17,120.71
You save:  ৳4,891.98
₹8,994.18
List Price:  ₹12,592.21
You save:  ₹3,598.03
RM413.15
List Price:  RM578.43
You save:  RM165.28
₦144,745.52
List Price:  ₦202,649.52
You save:  ₦57,904
₨28,176.09
List Price:  ₨39,447.65
You save:  ₨11,271.56
฿3,203.67
List Price:  ฿4,485.27
You save:  ฿1,281.60
₺4,242.17
List Price:  ₺5,939.21
You save:  ₺1,697.03
B$537.12
List Price:  B$751.99
You save:  B$214.87
R1,712.97
List Price:  R2,398.23
You save:  R685.25
Лв168.52
List Price:  Лв235.93
You save:  Лв67.41
₩146,901.96
List Price:  ₩205,668.62
You save:  ₩58,766.66
₪325.43
List Price:  ₪455.62
You save:  ₪130.18
₱5,865.61
List Price:  ₱8,212.09
You save:  ₱2,346.47
¥15,602.16
List Price:  ¥21,843.65
You save:  ¥6,241.48
MX$1,831.60
List Price:  MX$2,564.31
You save:  MX$732.71
QR366.07
List Price:  QR512.51
You save:  QR146.44
P1,336.69
List Price:  P1,871.42
You save:  P534.72
KSh12,928.70
List Price:  KSh18,100.70
You save:  KSh5,172
E£4,753.35
List Price:  E£6,654.88
You save:  E£1,901.53
ብር15,640.38
List Price:  ብር21,897.16
You save:  ብር6,256.77
Kz91,234.01
List Price:  Kz127,731.27
You save:  Kz36,497.25
CLP$92,959.70
List Price:  CLP$130,147.30
You save:  CLP$37,187.60
CN¥706.90
List Price:  CN¥989.70
You save:  CN¥282.79
RD$6,257.36
List Price:  RD$8,760.56
You save:  RD$2,503.19
DA13,031.68
List Price:  DA18,244.87
You save:  DA5,213.19
FJ$227.30
List Price:  FJ$318.23
You save:  FJ$90.93
Q767.59
List Price:  Q1,074.66
You save:  Q307.06
GY$20,952.92
List Price:  GY$29,334.92
You save:  GY$8,382
ISK kr12,766.72
List Price:  ISK kr17,873.92
You save:  ISK kr5,107.20
DH926.11
List Price:  DH1,296.60
You save:  DH370.48
L1,699.08
List Price:  L2,378.78
You save:  L679.70
ден5,308.64
List Price:  ден7,432.31
You save:  ден2,123.66
MOP$803.45
List Price:  MOP$1,124.87
You save:  MOP$321.41
N$1,710.78
List Price:  N$2,395.16
You save:  N$684.38
C$3,685.51
List Price:  C$5,159.87
You save:  C$1,474.35
रु14,346.56
List Price:  रु20,085.75
You save:  रु5,739.19
S/336.70
List Price:  S/471.40
You save:  S/134.69
K430.39
List Price:  K602.56
You save:  K172.17
SAR375.34
List Price:  SAR525.50
You save:  SAR150.15
ZK2,295.99
List Price:  ZK3,214.48
You save:  ZK918.49
L438.46
List Price:  L613.87
You save:  L175.40
Kč2,081.70
List Price:  Kč2,914.46
You save:  Kč832.76
Ft32,846.48
List Price:  Ft45,986.39
You save:  Ft13,139.90
SEK kr945.94
List Price:  SEK kr1,324.36
You save:  SEK kr378.41
ARS$145,114.23
List Price:  ARS$203,165.73
You save:  ARS$58,051.50
Bs694.55
List Price:  Bs972.40
You save:  Bs277.84
COP$375,380.15
List Price:  COP$525,547.23
You save:  COP$150,167.07
₡49,318.20
List Price:  ₡69,047.45
You save:  ₡19,729.25
L2,637.25
List Price:  L3,692.26
You save:  L1,055
₲700,071.99
List Price:  ₲980,128.80
You save:  ₲280,056.80
$U3,927.20
List Price:  $U5,498.24
You save:  $U1,571.03
zł365.38
List Price:  zł511.55
You save:  zł146.16
Already have an account? Log In

Transcript

Hello, in this last lesson, we are gonna look at tuples. So it's essentially a data very similar to a list. And there's two main sort of differences. One, you create it with a bracket just sequences, not a square bracket. And the other difference is you can actually update data of the tuple. It's essentially read only so this line here would be valid.

So if I were to do in the case of a list or some list, I did three times selecting before in the fourth one, n plus one. So this one, if I were to make it equal to six, for example. And if I were to just copy this line, I'm gonna get a result. What we'll get is people printed out and then updated and then it printed out again, with the data value, so it gets printed out 4.5 then it gets printed out at six, we have the updated value. So let me show you a tuple. So two, awesome is very similar.

So it is, you know, I'll just copy the contents are separated by commas. Copy that inside here. And now to access it, it's very similar. So we just get hold of this, put it here. Instead, we're going to put and if I run that, I haven't actually tried to assign a value to it yet, but we'll get around to that in a moment. So as you can see, the result is the entire list.

First element, the last element, just a couple of the elements and Then your data element. Now the two port, the first element, the last one, and there's a couple of the elements that you can see it's square brackets here, child brackets mean rounded parentheses here. But now if I were to try and do this, so instead, I'm doing awesome to pool. Awesome to pool, click work. We get a runtime. So get an error, because we can't see two bar object does not support item assignment.

So this is in valid. So that's it for two points, very similar to lists. So if you want lift, like functionality, we don't want that a no developer to be able to edit the content, update the contents, then you know, it's a great alternative, a essentially a read only list. Thanks for watching this video. And I look forward to seeing you in the next one.

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.