Unlocking the Secrets of Python: A Cybersecurity Enthusiast’s Journey

Fortune Edema
3 min readJan 13, 2023
Python Logo

Are you ready to embark on a journey of discovery and learning? I am a cybersecurity enthusiast and I am taking the path of an Ethical Hacker. As an Ethical Hacker, it is crucial to learn how to build, break, manipulate, and secure networks, systems, people, and processes. That’s why I decided to learn Python, one of the most powerful programming languages out there.

You may be wondering, why Python? Well, for starters, it is a high-level programming language that is mostly used for automation, data science, and more. Moreover, it is known for its simplicity and ease of use, which makes it a great choice for beginners. In fact, studies have shown that 60% of people who start coding, stop because of its complexity. But with Python, that complexity is minimized.

Since I use Ubuntu, a Linux-based operating system, I will be sharing my experience of how I started learning Python on my favorite OS. The first step was to install Python, which is the only way my program will run. Python uses an interpreter, a software that interprets the Python language, to tell the computer what your code is and how to perform tasks associated with your code.

After installing Python, I set out to find a suitable, lightweight IDE or text editor. An IDE (Integrated Development Environment) is a software with a compelling GUI for programming, while a text editor is a note-taking software that you can use to write and save your programs to run manually. I opted for Visual Studio Code, installed it on my Linux machine, and I was ready to go.

With my IDE set up, I created a folder on my Linux machine, opened Visual Studio Code, and made it access that folder. I then created a Python file under that folder and saved it. I was so excited to write my first program, and I couldn’t wait to dive in. My first Python code was:

import datetime
print("This is the current date and time")
print(datetime.datetime.now())

#The Result should be
2023-01-10 09:40:55.377773

You may be wondering, “That’s it? Where’s the ‘Hello World’?” Well, my first program was a little more advanced than that. But don’t worry, I’ll break it down for you. The first line is a function in Python used for manipulating date and time. We are calling it with the method import. The second line is printing a string “This is the current date and time.” And the last line is telling the function to print the current date and time.

Diving deeper into Python, I learned that Python uses variables to store values. These values can be strings, integers, or even boolean datatypes. Datatypes are how data is represented. For example:

mynumber = 22
mytext= "Hello world"
print(mynumber,mytext)

#The result would be
22 Hello world

In this example, mynumber and mytext are the variables, while 22 and “Hello world” are the values assigned to the variables. 22 is an integer, while “Hello world” is a string.

That’s just the tip of the iceberg of my journey learning Python programming language for cybersecurity. I will be skipping some details, but I promise you it will be an enjoyable read. In the next paragraph, I will take you through working with lists and dictionaries, another important part of my Python journey.

As I continued on my journey learning Python, I discovered that working with lists and dictionaries was another essential part of it. Lists are enclosed in [] square brackets and items are separated by a comma. For example:

student_grades = [9.2, 8.4, 7.3]

Dictionaries, on the other hand, contain key-value pairs. In the example below, “Mary” is the key, and 9.2 is the value, separated by a colon:

student_grades = {"Mary":9.2, "Matt":8.4, "Fortune":7.3}

Exploring these data structures was really fun for me because it helped me to structure problems in the real world. I can’t wait to explore more, and I hope you’re excited too.

I discovered that learning programming requires three things:

  1. Knowing the syntax of the particular language
  2. Knowing the most efficient data structure for a particular scenario
  3. Knowing the algorithms, the step-by-step logic to achieve a particular task

Isn’t that cool?You may be wondering why I didn’t talk about tuples. That’s because they are not as dynamic as lists and dictionaries.

That’s all for today, until we meet again. Happy reading!

--

--

Fortune Edema

Information Security Associate ISO IEC 27001 ||Tech Enthusiast||InfoSec Researcher|| Jnr SOC Analyst ||Security Awareness||Computer Science Student