Okay, so you know strings, you know
floats, you know integers, you know lists.
Okay, so you know data types, but how
can you actually do something in Python?
What can you do with these data types?
Well, to answer your question, you
should look at the dir command.
But let me now start to use the Python
shell a little bit more to do things quick.
So I'm going to split this into two.
This is for executing the Python file.
This is for the Interactive Python Shell.
So what can we do with list?
You can find that out by doing dir.
dir is a function in Python that will give you
[No audio]
all the things you can do with a specific type.
So with a list, in this case,
all this here are attributes of list.
You can do the same for checking int.
[No audio]
You can do the same for checking floats.
dir float, dir str.
[No audio]
For example, let's do it with str before we go to list.
With strings you can do for example, you
can turn them into uppercase using these methods.
To find out what upper does, you want to use help(str),
that is a type that has the attribute upper.
Now attributes are all these and they
can be either methods or properties.
You don't know that until you check with help.
[No audio]
So that is a help documentation for the upper method.
It's a method as you can see here. q
to quit and go back to the shell,
and then let's go ahead and use that.
"hello".upper().
You use a method with round brackets with parentheses
and that will return the capitalized version of hello.
If we used title instead, that
will capitalize the first letter only.
Of course, you can use variables,
[Author typing]
and you get the same output.
Now, what do we have for lists?
How about calculating the average
of the student_grades?
Let's do that in the next video.
[Outro sound]