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
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
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
In the last lectures, we talked about the basics of variables.
What is the variable?
What is the purpose of a variable and how to declare variables.
Now we'll take a look at what type of data can be stored in a variable.
Python is a dynamically typed programming language, and this is in contrast to C, C++, Java or GO,
which are statically typed.
A language is statically typed.
If the type of a variable is known at compile time or before running the program.
This is Java code.
Before running this program, I know that the variable score is of typing.
This means that the parameter must specify the type of data that will be stored in the variable when
he defines the variable in a statically typed language like Java.
A variable would be declared as an int score and then defined as score equals ten.
I'm running the program.
A language like Python is dynamically typed and it means that the type is associated with runtime values
and not with named variables.
So the values stored in variables have types and not the name or the variable itself.
This means that you as a developer can write code a little bit quicker because you never have to specify
variable types.
In Python, we create a variable named score simply by writing a score equals ten.
We can see what type of data a variable stores using the built in function type.
Print type of score.
For example, this is of typing.
Each variable or object.
A variable is in fact an object or an instance of a class has a type of value and an ID, and they are
constant during the variable lifetime.
I am declaring another variable A equals five and print type of A and then a equals python.
And print type of a.
A was of type in and then of type STR.
In fact they are different variables or were saved at different addresses.
Earlier, I said that the variable has a constant ID.
What is that ID and how do we get it?
The builtin function ID returns the memory address where the value referenced by the variable is stored
or simply said.
This is the address of the variable in memory.
If I write, my var equals ten.
Then my var is the reference to an integer object containing the value ten and is located at the memory
address returned by the ID function.
Now this is memory address.
In conclusion, statically typed languages have better performance at runtime and are faster.
This is because there is no need for type checking at runtime, but dynamically typed languages are
comparatively faster during development time and are more flexible.
Of exit.
In this video, you will learn the differences between statically and dynamically typed programming
languages, and that python is the dynamically typed one.
Next, we'll move to built in data types.
I'll see you soon.
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.