Skip to content

Instantly share code, notes, and snippets.

@devansqa14
devansqa14 / homework.py
Created August 20, 2025 00:43
lesson10.hw
# Homework: Classes
# Read carefully until the end before you start solving the exercises.
# Practice the Basics
# Basic Class
# - Create an empty class HouseForSale
# - Create two instances.
# - Add number_of_rooms and price as instance attributes.
@devansqa14
devansqa14 / homework.py
Created August 20, 2025 00:41
lesson9.hw
# HOMEWORK: Dictionaries
# Read carefully until the end before you start solving the exercises.
# Basic Dictionary
# Create an empty dictionary and then add a few of your friends. Make the key their email (can be fake)
# and the value their name. When you're done, create the same dictionary as a pre-populated dictionary.
friends = {}
friends['jack@example.com'] = 'Jack Jacobs'
@devansqa14
devansqa14 / lesson8hw
Created August 11, 2025 00:38
homework.py
# HOMEWORK: Functions
# Read carefully until the end before you start solving the exercises.
# Basic Function
# Define a basic function that only prints Hello. Create the definition using def and the call that executes it.
def say_hello():
print('Hello')
say_hello()
@devansqa14
devansqa14 / homework.py
Created August 10, 2025 18:04
lesson7hw.py
# Homework: Loops
# 🔥Read carefully until the end before you start solving the exercises🔥
# Practice the Basics 💪🏻
# You can uncomment or type the necessary code on each task
# ---------------------------------------------------------------------
# Task 1. Create a basic for loop
@devansqa14
devansqa14 / homework.py
Created August 4, 2025 01:48
lesson6hw
# Homework: Lists
# 🔥Read carefully until the end before you start solving the exercises🔥
# Practice the Basics 💪🏻
# Empty, Pre-populated, and Lists within Lists
# You can uncomment or type the necessary code on each task
@devansqa14
devansqa14 / homework.py
Created August 3, 2025 03:43
lesson4hw
# Homework Lesson 4 - Conditionals
# READ CAREFULLY THE EXERCISE DESCRIPTION AND SOLVE IT RIGHT AFTER I
# ------------------------------------------------------------------
# Exercise 1: Temperature Classification
# You're developing a weather application. Write a program that take
# a temperature in Fahrenheit as input. If the temperature is above
# 85°F, print "Hot day ahead!".
temperature = int(input("Enter the temperature in Fahrenheit: "))
@devansqa14
devansqa14 / homework.py
Last active August 2, 2025 16:09
lesson_3.py
# Homework Lesson 3 - Strings
# READ CAREFULLY THE EXERCISE DESCRIPTION AND SOLVE IT RIGHT AFTER IT
# ---------------------------------------------------------------------
# Exercise 1: Personalized Greeting
# Write a program that takes a user's name as input
# and then greets them using an f-string: "Hello, [name]!"
#
# Example Input: "Alice"
@devansqa14
devansqa14 / homework2.py
Last active August 1, 2025 23:48
lesson2_hw
# Homework Lesson 2 - Numbers - Homework
from typing import final
# READ CAREFULLY THE EXERCISE DESCRIPTION AND SOLVE IT RIGHT AFTER IT
# ---------------------------------------------------------------------
# Exercise 0 - This exercise is solved so you can have an ----------
# example of how we are expecting your answers to be.
#
# You are shopping online and found two items with prices $5.99