Time
2 hours 57 minutes
Difficulty
Beginner
CEU/CPE
3

Video Transcription

00:00
Hello, everyone. And welcome back to intrude a python here on cyber Eri on demand. You're watching lesson seven, the final lesson of module one, and you're watching it here with me. Your instructor, Joe Perry,
00:12
today in less than seven, What we're gonna cover are the Four Python data types are actually more than four python data types. But these are the four we're gonna worry about strings, numbers, lists and dictionaries. So we're gonna try and do this all in one fell swoop. We're gonna just run through each of them. Each of these, by the way, is actually going to be the subject of its own lesson
00:30
in module. Two strings, numbers, lists and dictionaries all get a deep dive lesson in
00:34
module too. So don't worry too terribly much if you don't necessarily know what all or how to use all of them at the end of this video, most of them were just there so that we know we know what they are and are familiar with, um when we see them in the code for the next module.
00:46
So the first example strings
00:50
you may remember from our variable, uh, lesson variables are Tupperware for your brain.
00:58
They're just places to store. Data strings and python are delineated are denoted rather
01:03
by using quotes either double or single quotes.
01:06
In this case, you can write something. For example,
01:11
we are the knights who say
01:15
me
01:15
you don't know that reference That is a money python reference. In fact, in the name of the Python programming language I didn't mention it before is actually a reference to Monty Python. So you're gonna see a lot of jokes about money Python When you're going through
01:27
code and documentation in tutorials for this language,
01:30
X is now the stream. We are the knights who say ni, we can print X as we've done with hello world,
01:38
and it will work just fine. In fact, instead of doing credits,
01:42
hello
01:45
going,
01:48
We could have simply set that string ableto a variable
01:57
imprinted it that way.
01:59
Now it's worth noting that, you know, in a lot of cases strings people will want to just print the string directly.
02:05
It's not a terrible situation to do that in python. Pythons are relatively memory safe language, so you can usually get away with directly printing strings. But when you're working with some modules, for example, Sequel. You usually want to interpret it through a variable because there are ways you can implement security by using the variable instead of just using mystery directly. And then, of course,
02:23
having variables where people can store in put strings is always essential.
02:27
So those were strings. Wrong command those air strings. Now we're gonna go ahead. We're gonna talk about numbers in python on numbers and python work exactly the same way that strings do, except they're created without quotes.
02:38
Now, if you're familiar with other languages, you may know that in for example, see, there are a whole bunch of different types of number. There are integers. There are
02:46
floats there bulls, which are actually just numbers and see their bulls. There are Long's their doubles, their words or quad words, all sorts of different types of number in python. Those are all abstracted out, and you just have numbers so you can have Z equals 1.24 You could have Z equals. You could have w equal
03:07
14 over to anything, and of course, that will actually evaluate out
03:12
and just performed seven. Now you'll notice that that seven has a decimal like the 1.24 did. But neither of these numbers had that. That's because division and python automatically assigns afloat, afloat under the hood, so it's still usable as a normal python number. But you will see the decimal place because Python is interpreting it as a float, which is an editor with decibel
03:31
places.
03:34
You can do math and python. I actually often use Python just four map because it's often faster than
03:39
finding the calculator and opening that up.
03:43
So, for example, seven to the 13th power you confined with seven Star Star 13 you could do normal addition.
03:52
Well, not what I meant to do. There
03:57
you can do subtraction.
04:00
And, of course, you can store the result of these things
04:05
in variables
04:12
numbers in Python. Pretty straightforward. You're gonna use those all the time. As I mentioned, they're often used for control values or to interpret menus or for all sorts of other things. But that's all numbers are in Python
04:21
now in the next video, because we're going to run up against our time here. In the next video, we're gonna discuss the next to Python data types, lists and dictionaries and those air to abstracted data types. We're gonna spend a little bit of time off.
04:33
Thank you for watching. As always, I'm your instructor, Joe Perry. I'm very happy to have you here. An intro. The python on Cyber Eri on demand.

Up Next

Intro to Python

This is an introductory course on Python for cyber security, giving students the ability to understand the basics of the language, solve problems with scripts and identify useful Python modules.

Instructed By

Instructor Profile Image
Joe Perry
Senior Technical Instructor at FireEye, Inc
Instructor