1 00:00:00,780 --> 00:00:07,860 Today is our first lesson in Python programming, Python is very easy and strong programming language 2 00:00:07,860 --> 00:00:13,800 that most hackers and penetration testers using nowadays to create testing tools and exploits. 3 00:00:15,360 --> 00:00:17,550 Let's begin with a simple hello world. 4 00:00:27,320 --> 00:00:33,830 In order for us to print the strength of the screen, we use the word print followed by space in the 5 00:00:33,830 --> 00:00:41,360 string we want to print and double quotes or single quotes in Python three, it's print followed by 6 00:00:41,720 --> 00:00:47,170 printing these, then the string you want to print and double quotes or single quotes. 7 00:00:48,050 --> 00:00:48,950 Let's try that. 8 00:01:09,810 --> 00:01:14,410 We can also add or concatenate strings together by using the plus sign. 9 00:01:15,240 --> 00:01:16,230 Let's see example. 10 00:01:26,740 --> 00:01:33,280 But in this example, we need to head a space either after the word hello or before the word world, 11 00:01:33,730 --> 00:01:37,330 or maybe we can separate a space as a string between them. 12 00:01:38,410 --> 00:01:39,250 Let's try again. 13 00:01:49,000 --> 00:01:49,450 Nice. 14 00:01:50,830 --> 00:01:58,900 Now let's see how we print an integer when printing an integer, we don't surround it in double quotes 15 00:01:58,900 --> 00:01:59,890 or single quotes. 16 00:02:04,450 --> 00:02:06,790 Can we print a number as a string? 17 00:02:07,660 --> 00:02:08,560 Yeah, sure. 18 00:02:09,970 --> 00:02:15,840 But by doing that, we can't use this number as an integer anymore because we have change its type. 19 00:02:16,780 --> 00:02:19,300 Let's verify that by using the word type. 20 00:02:34,850 --> 00:02:39,060 Let's create a variable called X and assign the number 10 to it as a strength. 21 00:02:39,620 --> 00:02:41,360 Then we add another number to it. 22 00:02:42,020 --> 00:02:43,040 Let's see what happens. 23 00:02:52,880 --> 00:02:58,520 See, it doesn't like adding string to integer, but how can we solve this? 24 00:02:59,450 --> 00:03:06,410 Well, we can change the type of X to integer and reassign it, or we can do it on the fly by adding 25 00:03:06,410 --> 00:03:08,750 the typecasting and in front of it. 26 00:03:09,440 --> 00:03:10,120 Let's try. 27 00:03:20,240 --> 00:03:25,100 Let's see how we subtract, divide and multiply in Python, which is very easy to do. 28 00:03:27,470 --> 00:03:35,630 We divide by using the force flash, we multiply by using the the asterisk and subtract by using the 29 00:03:35,630 --> 00:03:37,420 minus sine or dash. 30 00:03:50,570 --> 00:03:53,720 If we create a variable X with the value of ten 31 00:03:57,560 --> 00:04:04,340 and we want to add another number to it, we can do that by either using the traditional way X equals 32 00:04:04,340 --> 00:04:05,240 X plus 10 33 00:04:09,050 --> 00:04:11,540 or X plus equal 10. 34 00:04:18,500 --> 00:04:19,100 Same thing. 35 00:04:19,100 --> 00:04:22,760 If you want to subtract it will be X minus equal 10. 36 00:04:32,470 --> 00:04:37,860 Now, if we want to assign hex value to a variable, we can do that in two ways. 37 00:04:38,560 --> 00:04:44,140 First is to use the zero X to indicate we are using hex value. 38 00:04:44,440 --> 00:04:45,250 Let's try that 39 00:04:58,450 --> 00:05:00,340 or we can use the base 16. 40 00:05:12,910 --> 00:05:20,800 We can do the same thing with binary, but we need to have zero B in front of our binary number, let's 41 00:05:20,800 --> 00:05:22,600 print the number four in binary. 42 00:05:23,440 --> 00:05:32,420 The number four in binary is zero zero zero zero zero one zero zero or just hundred. 43 00:05:33,970 --> 00:05:34,780 Let's try that. 44 00:05:50,430 --> 00:05:52,470 Let's see the second way of using binary. 45 00:06:20,400 --> 00:06:28,500 Now, if we want to print a value is binary harrex, we can use the word bin for binary and hextor hexadecimal. 46 00:06:29,640 --> 00:06:33,210 Let's print the number two hundred and fifty five in binary and X. 47 00:06:42,580 --> 00:06:43,030 Nice. 48 00:06:44,380 --> 00:06:45,820 Let's go back to String's again. 49 00:06:46,720 --> 00:06:49,490 There are three ways to assign string in Python. 50 00:06:49,660 --> 00:06:51,400 First, using double quotes. 51 00:06:57,450 --> 00:06:59,580 Second, using single quote, 52 00:07:04,470 --> 00:07:06,720 third is using triple quotes, 53 00:07:14,800 --> 00:07:18,660 the triple quotes is very useful if you want to have multiple one string. 54 00:07:19,560 --> 00:07:20,460 Let's take a look. 55 00:07:37,200 --> 00:07:40,920 Now, what if you want to print a double quotes in our string? 56 00:07:42,720 --> 00:07:44,820 Let's try by using double quotes first. 57 00:07:56,260 --> 00:08:03,970 Oops, it didn't work in order to solve this, we have to escape our double quotes and treat it as a 58 00:08:03,970 --> 00:08:04,950 literal string. 59 00:08:05,470 --> 00:08:08,770 We can do that by adding backslash in front of each one. 60 00:08:18,570 --> 00:08:22,170 Another way is to surround the whole string in single quotes. 61 00:08:32,070 --> 00:08:33,840 We have reached the end of this lesson. 62 00:08:34,230 --> 00:08:35,940 Thank you and see you in the next one.