Skip to content

Instantly share code, notes, and snippets.

@lw13377
lw13377 / homework.py
Created June 15, 2024 04:27
lesson 13 hw
# Homework Lesson 13 - Workshop - Homework
# READ CAREFULLY THE EXERCISE DESCRIPTION AND SOLVE IT RIGHT AFTER IT
################################################################################
### When solving coding challenges, think about the time complexity (Big O). ###
################################################################################
# Challenge 1
# Common Elements Finder
@lw13377
lw13377 / homework.py
Created June 12, 2024 04:18
lesson 12 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.
@lw13377
lw13377 / homework.py
Created June 8, 2024 05:56
lesson 11 homework
test_scores = {
'James': 83,
'Julia': 91,
'Ryan': 90,
'Maria': 80,
'David': 79,
'Adam': 96,
'Jennifer': 97,
'Susan': 77
}
@lw13377
lw13377 / homework.py
Created June 5, 2024 08:50
lesson 10 homework
# Homework Lesson 10 - Workshop - Homework
# READ CAREFULLY THE EXERCISE DESCRIPTION AND SOLVE IT RIGHT AFTER IT
################################################################################
### When solving coding challenges, think about the time complexity (Big O). ###
################################################################################
# Challenge 1
# Multiplication of a three-digit number
@lw13377
lw13377 / homework.py
Created June 3, 2024 01:16
lesson 9 hw
# 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 greeting(hi):
print(hi)
greeting("Hello")
@lw13377
lw13377 / homework.py
Created May 29, 2024 22:06
Lesson 8 Homework
# Homework Lesson 8 - Workshop - Homework
# READ CAREFULLY THE EXERCISE DESCRIPTION AND SOLVE IT RIGHT AFTER IT
# Challenge 1
# Two Lowest Elements
#
# Your task is to write a program that takes a list of numbers and finds
# the two smallest numbers in it. The two smallest numbers can be equal to
# each other or different.
@lw13377
lw13377 / homework.py
Created May 24, 2024 08:30
lesson 7 homework
# 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
@lw13377
lw13377 / homework.py
Created May 22, 2024 04:17
lesson 6 homework
# 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
@lw13377
lw13377 / homework.py
Created May 17, 2024 04:52
lesson 5 homework
# Homework Lesson 5 - Workshop - Homework
# READ CAREFULLY THE EXERCISE DESCRIPTION AND SOLVE IT RIGHT AFTER IT
# Challenge 1
# Make a number Positive
#
# Create a variable called my_number and set it to any integer value.
# Write code to make the number positive if it's negative, and keep it
# as is if it's already positive or zero.
@lw13377
lw13377 / homework.py
Created May 15, 2024 10:31
lesson 4 homework
# Homework Lesson 4 - Conditionals
# READ CAREFULLY THE EXERCISE DESCRIPTION AND SOLVE IT RIGHT AFTER IT
# ---------------------------------------------------------------------
# Exercise 1: Temperature Classification
# You're developing a weather application. Write a program that takes
# 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: "))