Afrikaans
Akan
Albanian
Amharic
Arabic
Armenian
Azerbaijani
Basque
Belarusian
Bemba
Bengali
Bihari
Bosnian
Breton
Bulgarian
Cambodian
Catalan
Cebuano
Cherokee
Chichewa
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
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
alright everybody we are moving on to variables
a variable is a container for a value
there's four different data types we'll discuss
strings integers floats and booleans
yes I know that's a silly name
variable behaves as if it was the value it contains
each variable should have a unique name
let's say we have a variable of first name
to assign a variable
you use the assignment operator of equals
for text a string is a series of text
this can be double quotes or single quotes
my own preference is double quotes
why don't you type in your first name
this variable a first name
will behave as if it was this value
this series of characters
so to demonstrate this I'm going to print
my first name variable
so place it within a print statement without quotes
that will print your first name
now you don't want this within quotes
because then you're literally printing
the word first name
you could use your variable along with some text
by using what is called an F string
that's the easiest way to display a variable
so you type F
menasetic quotes
the F means format
so let's say the word hello
then we will add our variable
we will insert our variable into this text
when using an F string
to do that you need a set of curly braces
then insert your variable
so the result is hello
whatever your first name is in my case bro
let's create another variable
let's say we have a variable of food
food equals think of your favorite food
for me I will type pizza
let's print the following
you like add a placeholder
again I'm using an F string
our variable of food
hello bro you like pizza
let's create an email
use your own email or makeup 1
let's say my email is bro
onetwothreeatfake.com
then let's print our email
your email is at a placeholder
display our email variable
your email is bro 1 2 3 at fake com
so these are strings
I'm going to add a comment that these are strings
a string is a series of characters
they can include numbers
but we treat them as characters
now we have integers
an integer is a whole number
an example of this could
somebody's age
how old are they
according to my YouTube statistics
many of you are between the ages of 18 through 24
let's say that I'm 25
let me zoom in a little
your integer should not be within quotes
because it would be a string then technically
if I would like to work with this variable
again I'll use enough string
let's say you are
add a placeholder
display our age variable
years old
you are 25 years old
another example of an integer could be a quantity
you are buying a certain amount of something
maybe I am buying 3 items
I wouldn't have half an item
this would be a float technically
rather than an integer
we are buying 3 of something
so let's print the following
you are buying
at a placeholder
display our quantity
items
you are 25 years old
you are buying 3 items
another example of an integer could be
an amount of people
let's say number of students
like a classroom
there are 30 students in our class
then we will print
your class has at a placeholder
students we will display the number of students
number of students
your class has 30 students
those are integers
their whole numbers
and again make sure they're not within quotes
because then technically they would be a string
integers we can use in arithmetic expressions
if they were strings we couldn't
then we have floats
float means floating point number
a float is a number but it contains a decimal portion
an example would be a price
what is the price of something 1099
let's print our price
print I'll use an F string
the price is at a placeholder
display our price
the price is 10 99
let's precede our placeholder with a unit of currency
I'll pick American dollars
but feel free to pick something else
the price is 10 dollars and 99 cents
so floats contain a decimal portion
what about a grade point average GPA
let's say my GPA is 3.2
then I will print
your GPA is
display our GPA
your GPA is 3.2
what about a distance
a distance can contain a decimal portion
5.5 km maybe
then I will print
you ran at a placeholder
display our distance
then I'll add km4km
or you could add mi for miles but I'll stick with km
you ran 5.5km
k then we have booleans
a boolean is either true or false
let's say we are a student
is student equals
if we are a student we could say that this is true
true starts with a capital T
if we weren't a student let's say we graduate
we could say that this is false
again the first letter is capital
booleans only have two options true or false
so let's say that I am a student
then I will print
are you a student
then we will display our Boolean value of a student
are you a student that is true
with bullion values
we really don't output them directly
you're more
likely to see them used internally within a program
such as when working with if statements
this is a topic we'll discuss in the future
so don't worry
you may see if
is student if this variable is true
then we will print the following
now we don't need to use enough string
we're not going to insert any variables
you are a student
if this were false we can add an L clause
where we will print
you are not a student
our variable of a student is true
we will print the if statement
you are a student
if this were false we will print whatever is within
else
you are not a student
let's think of a few more examples
is something for sale
like a car or a product of some sort
let's say that is true
I'll write another if statement
if for sale if this variable contains true
we will do the
let's print
that item is for sale
else if it's false we will print something else
that item is not available
for sale is set to true
this variable is true
we will print that item is for sale
else if it were false
we print that item is not available
one more example
let's say we have a Boolean variable of is online
is somebody online
I will set that to true
if is online if that's true we will print you are
online
else we will print
you are offline
is online is set to true
we will print you are online
else if it were false we print your offline
alright everybody so those are variables
a variable is a reusable container for a value
there's four basic data types for beginners
a string which is a series of text
integers which are whole numbers
floats
which are numbers but they contain a decimal portion
and booleans which are either true or false
their binary your assignment in the comments section
is to post four variables
post a string an integer a float and a boolean
try and think of a unique example if you can
and well everybody those are variables in Python
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.