TryHacKMe | Python Basics | Walkthrough

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
site that's a split right here it just talks about the introduction answer your questions below uh run what's currently in the co-editor by clicking the Green Run code button on the right hand side of your screen so when you click run code learn security with try have very complete uh just letting you know guys I'm uh showing you guys how to complete these tasks I strongly recommend reach read through every task to get a full understanding all right all right let's go task two hello world so this is just a simple program output it says print hello o and answer the questions below on the Cod editor print hello world what is the flag so in the in the H in the Cod editor right hand side replace learn security would try hack me with hello world and click the Green Run code button so we're just gonna copy this all right hello world then run code and does answer DM print statements all right just running just in case cool all right click submit done all right let's go task three ma mathematical operators so talks about operator syntax example addition subtraction modifcation division modulus and exponent then there's loops and if statements okay then there symbol with syntax greater than less than equal to not equal to greater than or equal to less than equal so it's kind of simple answer questions below in the co-editor print the result 21 + 43 what is the flag hint and the co-editor on the right write the following print 21+ 43 so let's uh replace this 21 Space plus space 43 run code and thus answer THM addition all right next question print the result of 142 minus 52 what is the flag so 142 [Music] minus 52 all right there's THM M subtract then next is print the result of 10 * 342 what is the result all right it's [Music] 10 342 exercise complete T modification python then uh print the result of five square what is the flag hint so five [Music] das-2 so do the same Co and the answerers TM exponent power all right guys that was easy just learn about operator syntax and symbol and syntax all right task four variables and data types okay this is variable there an example string float integer Boolean Lisk so answer your questions below in the co-editor create a variable called height and set its initial value to 200 so let's uh h equals 200 all right on new line add 50 to the he variable so follow this example so height equals height plus 50 all right complete then another new line print out the value of the of height what is the flag that appears so X is print height and python goes 250 and that's variable teaching varibles all right cool all right let's go task five logical and bootan operators all right T about logical operation or operator see bootle operations there's and or not and there's example let's see a equals 1 if a equivalent to one or a greater than 10 then you print out a is either one or above 10 then there's name equal Bob hungry is true if name equ is Bob and Hungary is true then pron Bob is hungry else let's CEO I think it's uh equal L if name Bob not hungry then PR out Bob is not hungry else if all other if conditions are not met then PR out not sure who who this is or if they are hungry so read the above section complete all right top six shipping project introduction to if statement using IF statements all right talk about if start it's youer driver 17 no you're own enough dri stop yes you are not own enough to dri stop okay so answer your questions below in this exercise you will quote a small application. calculates outputs the shipping cost for a customer based on how much you spent click on in the code editor click on shipping. py Tab and follow instructions complete this task all complete once your R an application in the code editors shipping pyap a flag will appear what is the answer to this question need a hint on coeditor to the left of the Run code button there will be a hint button until you get started so you can do this on on your own or just put click hint so it'll pop out all right first one in this project will create a program that calculates the total cost of customer shopping basket including shipping if have a customer spend over $100 they will they get free shipping so if customer basket costs over 100 will get shipping if a customer spends less than $100 then the shipping cost is $120 per kilogram of the basket weight okay so it'll be shipping [Music] costs let's [Music] see shipping cost minus say customer basket cost that's it so it's basically shipping cost which is this one shipping cost equals customer's basket weight and shipping cost per kilogram so is these two and then you plus the basket cost right here since the shipping cost print the customer total basket cost including shipping to complete this exercise so it's shipping cost plus the customer basket cost and there you go THM if statement shopping total basket cost include shipping is 8 6.8 all right in shipping. online 12 when using coeditor hint change the customer basket cost variable to 101 and rerun your code you will get a flag if the total cost is correct based on your code the flag is the answer this question so it's asking to change 101 wait should be 12 see this no it's up cuz oh oops basket [Music] cost yeah there you go teach my first app free shipping total basket cost including shipping is 101 so all right I hope that that was easy guys uh if not just rewatch this part uh to seven loops so it talks about while Loops for loops and it says answer your questions below on a code editor click back on the script and a code code a loop that outputs every number from 0 to 50 and you can use a forward Loop or W Loop must print from 0 to 50 okay so you can read the while Loops for Loops uh but I'm we use the last example and it says right here in Python we can also iterate through a range of numbers using the range function below is some python code will print out numbers from 0 to four in Pro in program zero is often the starting number so counting to 5 to Z five is 0 to four [Music] so I we say for I in range 0 to 51 cuz we're we're doing 0 to 50 so 51 so 0 to 51 it should work or let's see bad input that oh wait there we go let's show you print I for B input well let's see that input L three for see for I in range 551 print I that's four Loops right see try this again 4 I in range [Music] 051 [Music] print oh there you go that was weird SP so D for Loops wow four okay all right guys uh let's go task eight Bitcoin project introduction to functions so it just talks about def name the par parentheses and col all right so answer the questions below you invest in Bitcoin want to write a program that tells you when the value of Bitcoin Falls Below in particular value dollars in the code parameter click on the bitcoin. py tab okay right function call Bitcoin to US USD with two parameters Bitcoin amount the amount Bitcoin you own and Bitcoin value US the value of Bitcoin and USD the function should return USD value which is your Bitcoin value in U USD to calculate this in the function you times Bitcoin variable by Bitcoin value ESD variable and return a value to start the function should look like this the all right once you written the Bitcoin to USD function use to use it to calculate the value Bitcoin and USD then create an if statements to determine if the if value if value Falls below $30,000 if it does the output message to alert you via print statement make sure your python function has the same has the name Bitcoin to USD and use use parameter names Bitcoin amount and Bitcoin value USD okay so you can click hint or you don't want to it's up to [Music] you so the first one it's this script right here Bitcoin amount bitcoint value okay all right let's see so star function looks like this it so when you once you written use the calculator value of Bitcoin in USD then create an if statement determine if the value Falls below $30,000 if it does I'll put me I'll put a message or alert you okay so USD value it's Bitcoin to us with two Bitcoin amount the function return us value which is U times Bitcoin amount all right let's okay see to calcul this you times Bitcoin amount variable by amount value USD okay what is so this one's easy then create if if statement the value Falls below $30 okay so that was $30,000 okay let's see write a function to calculate devcoin Bitcoin Bitcoin amount Bitcoin value TSD see PR function all right let's see Bitcoin to USD and and [Music] investment there you go so Bitcoin mod variable Bitcoin am variable by Bitcoin value so this is the Bitcoin value and variable amount so and that's it guys guys uh DM Bitcoin investor and then next question one Bitcoin is now worth $24,000 and co-editor in line 14 update the Bitcoin to USD variable to 24,000 and see your Pyon program recognizes that your investment is below the $30,000 brush and yes invest below $30,000 sell okay all right guys uh you guys got lost or still don't get it just rewatch this part it's prettyy simple if you uh just read through and follow step by step or you use the hint I did so all right task n files uh looks like just talk about the file name and it says answer your questions below in the code editor write python code to read the text file uh Tech uh text file what is the flag in this uh file okay so you follow along you can f equals open let's say flag x dot and print F read and yeah we simple just replace flag X read print f f all right all right guys uh last one test 10 Imports and answer questions relow is read the task and run the python example code above and the code editor on the right so this is just uh read the time right so import date time current time equals date time. date time. now and print corrent type all right it's number 10 7:35 all right that's it guys so you can share on Twitter Facebook link in um hit thumbs up you like this video comment below hit the Subscribe button hit the notification button uh this is the part of pentest learning path let's see all right so learn part of cont pentest plus and we just finished Pyon Basics the next one's be python for pentester and I'm going to reset this so anyways guys I'm not in the IT industry but it's something I really like doing uh I already did a video High I pass the compi A+ the Security Plus and the pentus Plus um then I'll be doing you know CA plus and network plus uh probably later after I finish the K pentest plus larning path and anyways guys you like this uh thanks for watching see you
Info
Channel: PLei
Views: 108
Rating: undefined out of 5
Keywords: Python, TryHackMe
Id: duPVUL2CG1Q
Channel Id: undefined
Length: 25min 42sec (1542 seconds)
Published: Mon Nov 13 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.