Wurztha's Game Dev Hub

Building games, one line of code at a time!

My Python Learning Journey

Welcome to my Python learning hub! Here I document what I'm learning, share code examples, and provide resources for anyone interested in getting started with Python.

Python Code Examples

Here are some examples of things I've been practicing:

1. Hello World & Variables

# My first Python program!
name = input("What's your name? ")
print(f"Hello, {name}!")

# Working with numbers
age = int(input("How old are you? "))
years_until_100 = 100 - age
print(f"You'll be 100 in {years_until_100} years.")

2. Loops & Conditionals

# FizzBuzz challenge (classic interview question)
for i in range(1, 101):
    if i % 15 == 0:
        print("FizzBuzz")
    elif i % 3 == 0:
        print("Fizz")
    elif i % 5 == 0:
        print("Buzz")
    else:
        print(i)

3. Working with Lists

# Shopping list manager
shopping_list = []

while True:
    item = input("Add item (or 'done' to finish): ")
    if item.lower() == 'done':
        break
    shopping_list.append(item)

print("\nYour shopping list:")
for i, item in enumerate(shopping_list, 1):
    print(f"{i}. {item}")

4. Functions & Reusability

# Temperature converter
def celsius_to_fahrenheit(celsius):
    return (celsius * 9/5) + 32

def fahrenheit_to_celsius(fahrenheit):
    return (fahrenheit - 32) * 5/9

temp_c = float(input("Temperature in Celsius: "))
print(f"That's {celsius_to_fahrenheit(temp_c)}°F")

Why I Love Python

After learning C first, Python feels like a breath of fresh air:

  • Readable syntax: Code looks almost like English
  • No semicolons or braces: Uses indentation instead
  • Built-in data structures: Lists, dicts, sets are first-class citizens
  • Huge standard library: "Batteries included" philosophy
  • Great for beginners: Less boilerplate, more focus on logic

C vs Python Comparison

// C version - verbose, manual memory management
#include <stdio.h>
int main() {
    int numbers[5] = {1, 2, 3, 4, 5};
    for (int i = 0; i < 5; i++) {
        printf("%d\n", numbers[i]);
    }
    return 0;
}

# Python version - clean and simple
numbers = [1, 2, 3, 4, 5]
for num in numbers:
    print(num)

Recommended Python Resources

Here are the best resources I've found for learning Python:

My Python Goals

Here's what I want to accomplish as I continue learning:

  • Short-term: Complete CS50's Python problem sets
  • Medium-term: Build a web scraper and data analysis tool
  • Long-term: Create my first game using Pygame
  • Dream project: Build a full-stack web application with Flask/Django

I'll be updating this page regularly as I progress on my journey!