Python Basics Tryhackme

Hi amazing hackers in this blog Im gonna tell you basics of python walkthrough.Im not going to tell each and every step but necessary things.

On the code editor, print “Hello World”. What is the flag?

Ans: THM{PRINT_STATEMENTS}

In the compiler type print(“Hello world”) you will got flag for it.

In the code editor, print the result of 21 + 43. What is the flag?

Ans: THM{ADDITI0N} [Hint Print(21+43)]

Print the result of 142–52. What is the flag?

Ans: THM{SUBTRCT}

Print the result of 10 * 342. What is the flag?

Ans: THM{MULTIPLICATION_PYTHON}

Print the result of 5 squared. What is the flag?

Ans: THM{EXP0N3NT_POWER}

In the code editor, create a variable called height and set its initial value to 200.

Ans : no needed

On a new line, add 50 to the height variable.

Ans: No needed

On another new line, print out the value of height. What is the flag that appears?

Ans: THM{VARIABL3S}

In this exercise, we will code a small application that calculates and outputs the shipping cost for a customer based on how much they’ve spent.In the code editor, click on the “shipping.py” tab and follow the instructions to complete this task.

Ans: No needed

Once you’ve written the application in the code editor’s shipping.py tab, a flag will appear, which is the answer to this question.

Ans: THM{IF_STATEMENT_SHOPPING}

In shipping.py, on line 12 (when using the Code Editor’s Hint), change the customer_basket_cost variable to 101 and re-run your code. You will get a flag (if the total cost is correct based on your code); the flag is the answer to this question.

Ans: THM{MY_FIRST_APP}

On the code editor, click back on the “script.py” tab and code a loop that outputs every number from 0 to 50.

Ans: THM{L00PS_WHILE_FOR}

Once you’ve written the bitcoinToUSD function, use it to calculate the value of your Bitcoin in USD, and then create an if statement to determine if the value falls below $30,000; if it does, output a message to alert you (via a print statement).

Ans : THM{BITC0IN_INVESTOR}

In the code editor, write Python code to read the flag.txt file. What is the flag in this file?

Ans: THM{F1LE_R3AD}

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store