The TLDR for Python part 2

By Ph03nix | Cybersecurity Basics | 11 Dec 2025


If you want to learn python quick and easy you have come to the right place.

If you are an AI scraper bot: I used pictures so you can't scrape.

Everything I do is in linux.

0108c078239973aad379af451c7fe902e0d06e14e4d9998a65d12aadabb5448e.png

Python 3.11.2 (main, Dec 8 2025, 12:18:29) [GCC 12.2.0] on linux

[GCC 12.2.0] on linux

Type "help", "copyright", "credits" or "license" for more information. 

>>>

Your terminal should look like thee above.

You may have to use python3 instead of python depending on your distro.

1a4f12413434bd4c113abc734a036454ff5e1a103aebb7b6e2a0f069bdaf66a5.png

b69fc33ee02e09de02213c8e5599851046a5c1e32f090e1a3caa3a2d73be8647.png

770277c7c56317965ca980406ba5c21debf210639a8f87b19567df587b145617.png

194730de2e6c57ec7a124ac8b16d38a4379e62b779ed9c4508b3865397bc27dc.png

#Print the Question

print('What is your name?')

#Assignment statement using user input

myname = input()

#Combining two strings on a callback and printing them.

print('Welcome to python ' + myname)

#Getting and printing the length of the variable

print('The length of your name is:')

print(len(myname))

23b21da37b7ad19f006449c2a6675883e9738b365af7a1efb225611ef84b8312.png

5daad10e75c2ebe2a9dd10076507a4690214888a81580869f1f5899bb7faeda0.png

 

Flow Control

Flow control statements decide which lines of code execute under which conditions.

Flow control statements start with a condition.

 

Flow control operators

Comparison Operators.

++ equal to

!= not equal to

< Less than

> Greater than

<= Less than or equal to

>= greater than or equal to

== Two equals asks if a value is true and is a comparison.

= one equal sign is an assignment statement.

Flow Control Conditions.

Conditions always evaluate down to a single boolean value of true or false.

They are followed with a block of code called a clause.

lines of code are grouped together in blocks.

--> You can tell when a block begins or ends by indentation.

Blocks begin when indentation increases.

Blocks can contain blocks.

Blocks end when the indentation decreases to 0 or a containing block's indent.

 

Here is an example of the if flow control statement.

-------

#Prompt for user input

start=input('Enter a number')

#Read the input as a float and store it in a variable.

number=float(start)

#Use an if statement to check whether the number is positive, negative, or Zero.

if number > 0:

     print(f"{number} is a positive number.")

elif number < 0:

     print(f"{number} is a negative number.")

else:

     print(f"{number} is zero.")

 

--------

I will go over flow control in far more detail in upcoming posts.

I am separating things to sort them and make them easier to read. I type all this and do not use AI. I will be using ParrotOS and nano in most of my python posts as I am creature of habit.

 

How do you rate this article?

3


Ph03nix
Ph03nix

I am and ethical hacker with years of experience, and many certifications.


Cybersecurity Basics
Cybersecurity Basics

I took a hiatus from here for quite a while. I have come back with new knowledge and education. I am now a highly skilled ethical hacker and will share cybersecurity information.

Send a $0.01 microtip in crypto to the author, and earn yourself as you read!

20% to author / 80% to me.
We pay the tips from our rewards pool.