Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/PythonforCybersecurity-example.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/inspectionProfiles/profiles_settings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion ShoppingList.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@ Milk
Break
Bananas
Eggs

Apples
Tomatoes
Cake
6 changes: 4 additions & 2 deletions end/CH02/HelloWorld.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#!/usr/bin/env python3
# A simple "Hello World" script in python
# Created by Ed Goad, 2/3/2021
print("Hello World")
# Created by Quentin Athula, 3/8/2025

your_name = input("what is your name? ")
print("Hello {0}".format(your_name))
7 changes: 6 additions & 1 deletion end/CH02/HelloWorld2.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
#!/usr/bin/env python3
# A simple "Hello World" script in python with Inputs
# Created by Ed Goad, 2/3/2021
# Created by Quentin Athula, 3/8/2025

your_name = input("What is your name? ")
print("Hello {0}".format(your_name))
print(f"Hello {your_name}")
print("Hello " + your_name)
print("Hello", your_name)
message = "Hello" + " " + your_name
print(message)
13 changes: 7 additions & 6 deletions end/CH02/SimpleCalculator.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
#!/usr/bin/env python3
# A simple calculator to show math and conditionals
# Created by Ed Goad, 2/3/2021
#!/user/bin/env python3
# A simple calculator script in python
# Created by Quentin Athula, 3/9/2025

# Get inputs first
# Note we are casting the numbers as "float", we could also do "int"
# Get input from the user
# Note we are casting the numbers as "float", we could also cast them as "int"
first_num = float(input("What is the first number: "))
activity = input("What activity? ( + - * / ) ")
second_num = float(input("What is the second number: "))

# depending on the selected activity, perform an action
# depending on the selected activity, perform the calculation
if activity == "+":
print(first_num + second_num)
if activity == "-":
Expand All @@ -17,3 +17,4 @@
print(first_num * second_num)
if activity == "/":
print(first_num / second_num)

6 changes: 3 additions & 3 deletions end/CH03/pinger1.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env python3
#!/usr/bin/venv python3
# First example of pinging from Python
# By Ed Goad
# 2/27/2021
# By Quentin Athula
# 3/15/2025

# import necessary Python modules
import platform
Expand Down
16 changes: 8 additions & 8 deletions end/CH03/pinger2.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
#!/usr/bin/env python3
#!/usr/bin/venv python3
# Second example of pinging from Python
# By Ed Goad
# 2/27/2021
# By Quentin Athula
# 3/15/2025

# import necessary Python modules
import platform
import os

# Assign IP to ping to a variable
ip = "127.0.0.1"
# Determine the currrent OS
currrent_os = platform.system().lower()
if currrent_os == "windows":
# Build our ping command for Windows
ping_cmd = f"ping -n 1 -w 2 {ip} > nul"
# Determine the current OS
current_os = platform.system().lower()
if current_os == "darwin":
# Build our ping command for darwin
ping_cmd = f"ping -n 1 -w 2 {ip} > /dev/null 2>&1"
else:
# Build our ping command for other OSs
ping_cmd = f"ping -c 1 -w 2 {ip} > /dev/null 2>&1"
Expand Down
10 changes: 5 additions & 5 deletions end/CH03/pinger3.py
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
#!/usr/bin/env python3
# Third example of pinging from Python
# By Ed Goad
# 2/27/2021
# By Quentin Athula
# 3/16/2025

# import necessary Python modules
import platform
import os

# Define the prefix to begin pinging
ip_prefix = "192.168.0."
# Determine the currrent OS
currrent_os = platform.system().lower()
# Determine the current OS
current_os = platform.system().lower()
# Loop from 0 - 254
for final_octet in range(254):
# Assign IP to ping to a variable
# Adding 1 to final_octet because loop starts at 0
ip = ip_prefix + str(final_octet + 1)
if currrent_os == "windows":
if current_os == "windows":
# Build our ping command for Windows
ping_cmd = f"ping -n 1 -w 2 {ip} > nul"
else:
Expand Down
2 changes: 1 addition & 1 deletion start/CH02/HelloWorld.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/usr/bin/env python3
# A simple "Hello World" script in python
# Created
# Created by Quentin Athula 7/8/2024
Empty file added start/CH02/HelloWorld1.py
Empty file.
6 changes: 3 additions & 3 deletions start/CH02/HelloWorld2.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
# A simple "Hello World" script in python with Inputs
# Created

# Suggestion, build out 1 line at a time
# Once multiple print statemetns exist, put a breakpoint at first print line
# Then walk through as an example of "debugging"
# your_name = input("wtat is your name? ")
# print("Hello {0}" format(your_name))