Python 10 Notes

You might also like

Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 1

chapter 10 notes

tuple, they are exactly like list but they are not mutable. the syntax is (",") .
it can contain both string and int. when i pass a string to a tuple, it splits each
alpha in to a different variable. slizing is exactly like you do in list. when ther
are two tuples which are idendical, it cannot compare the difference between them
if the only difference is between string and int. decorate, sort and undecorate.
idea is that, if i have
tuple assignment.
we defined three things and put an equal sign. in this way we assign corresponding
values to corresponding variables.
i can use these variable individually as well. we can swap the values.
intro dictionary. it is also sequence but in the case of dictionary the index is a
key. key can be a number, or a string or anything we call hashable. hashab.e means
value that can be used to generate a hash key. dictionary is created using flower
bracket. dictionary will not maintain the oder in which we enter the keys and
values.
while trying to topen a file, the file name should always be put in quotes.

You might also like