0% found this document useful (0 votes)
2 views2 pages

Python Programming Basics Quick Reference

The document provides a quick reference guide to Python programming basics, covering variables, core data types, lists, dictionaries, conditional logic, and loops. It explains that Python dynamically handles data types and illustrates the use of lists and dictionaries with examples. Additionally, it emphasizes the importance of indentation for defining block structures in Python syntax.

Uploaded by

thomasfrost369
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views2 pages

Python Programming Basics Quick Reference

The document provides a quick reference guide to Python programming basics, covering variables, core data types, lists, dictionaries, conditional logic, and loops. It explains that Python dynamically handles data types and illustrates the use of lists and dictionaries with examples. Additionally, it emphasizes the importance of indentation for defining block structures in Python syntax.

Uploaded by

thomasfrost369
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Python Programming Basics

Quick Core Language Syntax and Structure Reference Guide

1. Variables and Core Data Types

Python dynamically handles data types. You don't need to explicitly declare types when binding
values to variables.

# String, Integer, Float, and Boolean declarations


username = "Elliot"
login_attempts = 3
pi_value = 3.1415
is_admin = True

2. Lists and Dictionaries

Lists represent ordered sequences, while dictionaries map structured key-value pairs.

# Lists (Ordered, mutable sequences)


tools = ["nmap", "wireshark", "metasploit"]
[Link]("hydra")

# Dictionaries (Key-Value structural maps)


target_host = {
"ip": "[Link]",
"status": "active",
"open_ports": [22, 80, 443]
}

3. Conditional Logic and Loops

Indentation defines block structures strictly in Python syntax.

# Conditional Branching
if target_host["status"] == "active":
print(f"Scanning target: {target_host['ip']}")
else:
print("Target system is offline.")

Page 1
# Iterating via For Loops
for tool in tools:
print(f"Initializing {tool} framework...")

Page 2

You might also like