Afrikaans
Akan
Albanian
Amharic
Arabic
Armenian
Azerbaijani
Basque
Belarusian
Bemba
Bengali
Bihari
Bosnian
Breton
Bulgarian
Cambodian
Catalan
Cebuano
Cherokee
Chichewa
Chinese (Simplified)
Chinese (Traditional)
Corsican
Croatian
Czech
Danish
Dutch
English
Esperanto
Estonian
Ewe
Faroese
Filipino
Finnish
French
Frisian
Ga
Galician
Georgian
German
Greek
Guarani
Gujarati
Haitian Creole
Hausa
Hawaiian
Hebrew
Hindi
Hmong
Hungarian
Icelandic
Igbo
Indonesian
Interlingua
Irish
Italian
Japanese
Javanese
Kannada
Kazakh
Kinyarwanda
Kirundi
Kongo
Korean
Krio (Sierra Leone)
Kurdish
Kurdish (Soranรฎ)
Kyrgyz
Laothian
Latin
Latvian
Lingala
Lithuanian
Lozi
Luganda
Luo
Luxembourgish
Macedonian
Malagasy
Malay
Malayalam
Maltese
Maori
Marathi
Mauritian Creole
Moldavian
Mongolian
Myanmar (Burmese)
Montenegrin
Nepali
Nigerian Pidgin
Northern Sotho
Norwegian
Norwegian (Nynorsk)
Occitan
Oriya
Oromo
Pashto
Persian
Polish
Portuguese (Brazil)
Portuguese (Portugal)
Punjabi
Quechua
Romanian
Romansh
Runyakitara
Russian
Samoan
Scots Gaelic
Serbian
Serbo-Croatian
Sesotho
Setswana
Seychellois Creole
Shona
Sindhi
Sinhalese
Slovak
Slovenian
Somali
Spanish (Latin American)
Sundanese
Swahili
Swedish
Tajik
Tamil
Tatar
Telugu
Thai
Tigrinya
Tonga
Tshiluba
Tumbuka
Turkish
Turkmen
Twi
Uighur
Ukrainian
Urdu
Uzbek
Vietnamese
Welsh
Wolof
Xhosa
Yiddish
Yoruba
Zulu
1
Let's now look at tuples. In the
previous lecture we looked at lists and
3
tuples are very similar to lists, the
only difference is that tuples are not
5
mutable, so you cannot change a tuple.
Lists are used much more than tuples
7
so tuples are only using very specific
scenarios, so we will see some scenarios
9
throughout the course when we build the
real-world applications, so you don't
11
have to worry about understanding when
to use a tuple in programming for now.
13
Anyway I want to show you the syntax, so
you can create a tuple like that.
15
So tuples just like lists, they contain
they may contain different data types.
17
Let's say 3 4 and so on.
Oh sorry, I was writing in the
19
terminal, let me open the Python shell so
again
21
we have strings numbers and floats if you like.
Whatever type that you want you can pass
23
in a tuple and in a list and of course
you can use indexing for tuples as well,
25
so let's access the lost item and that
will give 4.6. The difference is that you
27
know tuples they have some slight
different methods than lists, so if you
29
dir list, you see that lists have
much more methods available than tuples,
31
so for instance you can append items to
a list, you can clear the list and copy
33
and count, count is available for tuples
because count doesn't change the data type,
35
so it doesn't change the tuple, it just
counts how many items are there in the tuple.
37
As I said, tuples are immutable, so you
cannot change them that's why these
39
methods that change the data type like
inserting new values and popping out
41
values, removing
values, reversing and sorting so these
43
are not available and yeah this is more or
less about tuples. In case you need them
45
later they are there for you. Hope you're
enjoying the course and I'll talk to you later.
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.