Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
28797fc
adding my warmup files for assignment2
invalid-email-address Jul 13, 2026
c981e33
warmups files
invalid-email-address Jul 13, 2026
e8c3550
warmups files
invalid-email-address Jul 13, 2026
02308a4
adding assignment 3 files
invalid-email-address Jul 21, 2026
a34c84b
adding friendly message to mini-project
invalid-email-address Jul 21, 2026
4bae462
adding updates suggested by the AI Review.
invalid-email-address Jul 21, 2026
bc422d8
adding updates suggested by the AI Review 2.
invalid-email-address Jul 21, 2026
199b846
adding updates suggested by the AI Review 3.
invalid-email-address Jul 21, 2026
d4921fd
adding updates suggested by the AI Review 3.
invalid-email-address Jul 21, 2026
f650354
adding updates suggested by the AI Review 4.
invalid-email-address Jul 21, 2026
d1def7c
adding updates suggested by the AI Review 5.
invalid-email-address Jul 21, 2026
4dfb92f
adding updates suggested by the AI Review 6.
invalid-email-address Jul 21, 2026
bdb834a
adding updates suggested by the AI Review 7 adding parity for zero.
invalid-email-address Jul 21, 2026
e6c5931
adding updates suggested by the AI Review 7 changing text for enter y…
invalid-email-address Jul 21, 2026
95cf879
adding updates suggested by the AI Review 7 changing text for enter y…
invalid-email-address Jul 21, 2026
8857c92
adding updates suggested by the AI Review 8
invalid-email-address Jul 21, 2026
be29fbc
adding updates suggested by the AI Review 9
invalid-email-address Jul 21, 2026
c85ac91
adding updates suggested by the AI Review 10
invalid-email-address Jul 21, 2026
9a83076
adding updates suggested by the AI Review 11
invalid-email-address Jul 21, 2026
e00257c
adding updates suggested by the AI Review 12
invalid-email-address Jul 22, 2026
be501cd
adding updates suggested by the AI Review 13 asking for the user age.
invalid-email-address Jul 22, 2026
2d0f1fe
adding updates suggested by the AI Review 14
invalid-email-address Jul 22, 2026
5b89a26
adding an else statement to warmup2.py
invalid-email-address Jul 27, 2026
f4eba32
adding week-4 assignment files
invalid-email-address Jul 28, 2026
a2c2ca6
fixing warmup1 to only asks for the four middle items
invalid-email-address Jul 28, 2026
33ed4f3
changing warumup2 from sets to list and updating output to include ke…
invalid-email-address Jul 28, 2026
736aef2
formatting average in the mini_project by 1 decimal point, removing t…
invalid-email-address Jul 28, 2026
33d2e00
adding all files for week 5 lesson
invalid-email-address Aug 5, 2026
6680be1
updated warmup3.py to remove the capitlize function and simplifed the…
invalid-email-address Aug 5, 2026
f2bd9da
fixing the bubble sort to include a full pass until it produces zero
invalid-email-address Aug 5, 2026
c1ab56d
fixed sorted lists was stuck in a infinite loop
invalid-email-address Aug 5, 2026
74253cd
adding files for week 6 assignment
invalid-email-address Aug 11, 2026
3e7ec5b
fixing directory structure for assignment 6
invalid-email-address Aug 11, 2026
306bb59
fixing warmup1 to have 3 function call
invalid-email-address Aug 11, 2026
e461ec5
fixing warmup2 pull print statemsnts out of functions
invalid-email-address Aug 11, 2026
c4158cb
add = to the conversion and removing to
invalid-email-address Aug 11, 2026
c8f6eb8
adding the isinstance function to check if the input is an integer
invalid-email-address Aug 11, 2026
dcdf3d2
add C to F on the last line
invalid-email-address Aug 11, 2026
2d1778b
updating warmup4 to check for other characters that numbers 0 to 9
invalid-email-address Aug 11, 2026
646b67d
removing int from input on the menut and adding a sorted_numbers vari…
invalid-email-address Aug 12, 2026
ebe2264
update bubble_sort to return the sorted_numbers list
invalid-email-address Aug 12, 2026
172758d
remove period from bubblesort print statement
invalid-email-address Aug 12, 2026
5c9241a
refactoring the search function to take 2 arguments numbers and target
invalid-email-address Aug 12, 2026
3e21c28
refactoring to add the NameError comment
invalid-email-address Aug 12, 2026
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
1 change: 1 addition & 0 deletions week-2/assignment-2/warmup1.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
print('Python is Working')
6 changes: 6 additions & 0 deletions week-2/assignment-2/warmup2.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#cd Desktop/CodetheDream/python/python-intro-homework
#ls
#cd week-2/assignment-2

today = input("What is today's date?")
print(f"You said today is {today}.")
2 changes: 2 additions & 0 deletions week-2/assignment-2/warmup3.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# git log --oneline output:
#c981e33 (HEAD -> assignment-2, origin/assignment-2) warmups files
4 changes: 4 additions & 0 deletions week-2/assignment-6/mini_project.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@

fahrenheit = float(input("Enter a temperature in Fahrenheit: "))
celsius = round(((fahrenheit-32) * 5/9), 1)
print(f"{fahrenheit}°F is {celsius}°C.")
1 change: 1 addition & 0 deletions week-2/assignment-6/warmup1.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
print('Python is Working')
6 changes: 6 additions & 0 deletions week-2/assignment-6/warmup2.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#cd Desktop/CodetheDream/python/python-intro-homework
#ls
#cd week-2/assignment-2

today = input("What is today's date?")
print(f"You said today is {today}.")
2 changes: 2 additions & 0 deletions week-2/assignment-6/warmup3.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# git log --oneline output:
#c981e33 (HEAD -> assignment-2, origin/assignment-2) warmups files
1 change: 1 addition & 0 deletions week-3/assignment-3/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.DS_Store
88 changes: 88 additions & 0 deletions week-3/assignment-3/mini_project.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
day = input("What day is it? ").lower()
timeOfDay = input("What time of day? ").lower()


if day=="sunday":
#timeOfDay = input("What time of day? ").lower()
if(timeOfDay == "morning"):
print("Suggestion: Good Morning, it's a great time to go for a walk!")
elif(timeOfDay == "afternoon"):
print("Suggestion: It's time for lunch.")
elif(timeOfDay == "evening"):
print("Suggestion: Good evening, it's time to make dinner!")
else:
print(f"Sorry, I don't recognize that time of day. Try: morning, afternoon or evening for the time of day.")

elif day=="monday":
#timeOfDay = input("What time of day? ").lower()
if(timeOfDay =='morning'):
print("Suggestion: Morning, it's a great time to make Pancakes for Breakfast!")
elif(timeOfDay == "afternoon"):
print("Suggestion: Good afternoon, it's a great time to read a book!")
elif(timeOfDay == "evening"):
print("Suggestion: Good evening, it's a great time to go to a friend's house.")
else:
print(f"Sorry, I don't recognize that time of day. Try: morning, afternoon or evening for the time of day.")

elif day=="tuesday":
#timeOfDay = input("What time of day? ").lower()

if(timeOfDay =='morning'):
print("Suggestion: Morning, it's a great time to go to a Cafe for Breakfast!")
elif(timeOfDay == "afternoon"):
print("Suggestion: Good afternoon, it's a great time to go to lunch!")
elif(timeOfDay == "evening"):
print("Suggestion: Good evening, it's a great time to go to the gym!")
else:
print(f"Sorry, I don't recognize that time of day. Try: morning, afternoon or evening for the time of day.")

elif day=="wednesday":
#timeOfDay = input("What time of day? ").lower()

if(timeOfDay =='morning'):
print("Suggestion: Morning, it's a great time to go for a run!")
elif(timeOfDay == "afternoon"):
print("Suggestion: Good afternoon, it's a great time to go to the grocery store.")
elif(timeOfDay == "evening"):
print("Suggestion: Good evening, it's a great time to a restaurant!")
else:
print(f"Sorry, I don't recognize that time of day. Try: morning, afternoon or evening for the time of day.")

elif day=="thursday":
#timeOfDay = input("What time of day? ").lower()

if(timeOfDay =='morning'):
print("Suggestion: Morning, it's a great time to have coffee!")
elif(timeOfDay == "afternoon"):
print("Suggestion: Good afternoon, it's a great time to go to the post office.")
elif(timeOfDay == "evening"):
print("Suggestion: Good evening, it's a great time to walk the dog!!")
else:
print(f"Sorry, I don't recognize that time of day. Try: morning, afternoon or evening for the time of day.")

elif day=="friday":
#timeOfDay = input("What time of day? ").lower()

if(timeOfDay =='morning'):
print("Suggestion: Morning, it's a great time to exercise!")
elif(timeOfDay == "afternoon"):
print("Suggestion: Good afternoon, it's a great time to play Ping Pong.")
elif(timeOfDay == "evening"):
print("Suggestion: Good evening, it's a great time to watch TV!")
else:
print(f"Sorry, I don't recognize that time of day. Try: morning, afternoon or evening for the time of day.")

elif day=="saturday":
#timeOfDay = input("What time of day? ").lower()

if(timeOfDay =='morning'):
print("Suggestion: Morning, it's a great time watch the news!")
elif(timeOfDay == "afternoon"):
print("Suggestion: Good afternoon, it's a great time to go for Ice Cream!")
elif(timeOfDay == "evening"):
print("Suggestion: Good evening, it's a great time to watch a movie!")
else:
print(f"Sorry, I don't recognize that time of day. Try: morning, afternoon or evening for the time of day.")
else:
print("Sorry, I don't recognize that day. Try: Monday, Tuesday, Wednesday...")

19 changes: 19 additions & 0 deletions week-3/assignment-3/warmup1.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#score = int(input("Pick any number between 0 and 100: "))

score = 54

if score >= 90 and score <=100:
print(f"Score: {score}")
print("Grade: A")
elif score >= 80 and score <=89:
print(f"Score: {score}")
print("Grade: B")
elif score >= 70 and score <=79:
print(f"Score: {score}")
print("Grade: C")
elif score >= 60 and score <=69:
print(f"Score: {score}")
print("Grade: D")
elif score >= 0 and score <=59:
print(f"Score: {score}")
print("Grade: F")
17 changes: 17 additions & 0 deletions week-3/assignment-3/warmup2.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
age = int(input("Enter your age:"))

if age>=0 and age<=12:
#print(f"Your age is {age}.")
print("You are a Child.")
elif age>=13 and age<=17:
#print(f"Your age is {age}.")
print("You are a Teen.")
elif age>=18 and age<=64:
#print(f"Your age is {age}.")
print("You are an Adult.")
elif age>=65:
#print(f"Your age is {age}.")
print("You are a Senior.")
else:
print("Invalid number, please enter a valid number.")

5 changes: 5 additions & 0 deletions week-3/assignment-3/warmup3.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
print(not True and False) #not True is False; False and False is False
print(True or False and False) # False is False is False; True or False is True;
print(not (5 > 3)) # 5 is greater than 3 which is True; Not True is False
print(10 == 10 and 4 != 4) # 10==10 is True; and 4!=4 is False; True and False is False
print(not False or not True) # Not False is True; not True is False; True or False is True
21 changes: 21 additions & 0 deletions week-3/assignment-3/warmup4.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
number = int(input("Enter a number: "))

# if/elif/else statement 1 for sign

if number>0:
print(f"{number} is positive.")

elif number< 0:
print(f"{number} is negative.")

else:
print(f"{number} is zero.")


# if/elif/else statement 2 for parity including zero

if number % 2 == 0:
print(f"{number} is even.")

else:
print(f"{number} is odd.")
43 changes: 43 additions & 0 deletions week-4/mini_project.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
students = [
{"name": "Jazmine", "score": 88, "subject": "Python"},
{"name": "Luis", "score": 74, "subject": "Data"},
{"name": "Sara", "score": 91, "subject": "Python"},
{"name": "Marcus", "score": 68, "subject": "Web"},
{"name": "Priya", "score": 95, "subject": "Data"},
{"name": "Devon", "score": 72, "subject": "Python"},
{"name": "Mia", "score": 83, "subject": "Web"},
{"name": "Eli", "score": 79, "subject": "Data"},
]
#Find the top scorer
top_scorer_name = ""
top_score = 0

for student in students:
if student["score"] > top_score:
top_score = student["score"]
top_scorer_name = student["name"]

print(f"Top scorer: {top_scorer_name} ({top_score})")

#Calculate the class average
total = 0
for student in students:
total+= student["score"]
average = total / len(students)
print(f"Class average: {average:.1f}") # Output: Class average: 85.5

#List all unique subjects

subjects = set()
for student in students:
subjects.add(student["subject"])

print(f"Subjects offered: {subjects}")

#List High Scorers with score over 75
high_scorers = []
for student in students:
if student["score"] >75:
high_scorers.append(student["name"])

print(f"High scorers: {high_scorers}")
6 changes: 6 additions & 0 deletions week-4/warmup1.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#Warmup 1 List Operations
numbers = [27, 40, 45, 50, 51, 52, 70, 99]
print(f"First: {numbers[0]}")
print(f"Last: {numbers[-1]}")
print(f"Middle: {numbers[2:6]} ")
print(f"Reversed: {numbers[::-1]} ")
14 changes: 14 additions & 0 deletions week-4/warmup2.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#Warmup 2 Dictonary Operations

students = {
"name": "Khalilah",
"grade": "A",
"subjects": ["English", "Math", "Computer Science"]
}
for key, value in students.items():
print(f"{key}: {value}")

students["graduated"] = False

for key, value in students.items():
print(f"{key}: {value}")
13 changes: 13 additions & 0 deletions week-4/warmup3.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#Warmup 3 Set Operations
language_list1 = ["BASIC", "Pascal", "Assembly", "Fortran", "C", "C++", "Perl", "Java", "XML", "HTML", "CSS", "JavaScript", "Visual Basic", "VB.NET", "C#"]
language_list2 = ["HTML", "XML", "CSS", "JavaScript", "TypeScript", "JSON", "PHP", "SQL", "Python"]

#Convert list to set

language_list1_set1 = set(language_list1)
language_list1_set2 = set(language_list2)

#print language sets
print(language_list1_set1 | language_list1_set2) # Union: All languages from both lists, no duplicates
print(language_list1_set1 & language_list1_set2) # Intersection: Languages in both lists
print(language_list1_set1 - language_list1_set2) # Difference: Languages only in the first list
11 changes: 11 additions & 0 deletions week-5/data/selection_sort.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
def selection_sort(data):
for i in range(len(data)):
min_index = i
for j in range(i + 1, len(data)):
if data[j] < data[min_index]:
min_index = j
data[i], data[min_index] = data[min_index], data[i]
return data

sorted_list = selection_sort(numbers)
print(f"Minimum number is {sorted_list[0]}")
74 changes: 74 additions & 0 deletions week-5/mini_project.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
numbers = [42, 17, 83, 5, 61, 29, 74, 8, 55, 93, 31, 66, 14, 47, 78, 3, 59, 22, 86, 40]

while True:
#Print Number Cruncher Menu
print("")
print("=== Number Cruncher ===")
print("1. Find minimum")
print("2. Find maximum")
print("3. Search for a number")
print("4. Sort the list")
print("5. Quit")
print("")

option = int(input("Choose an option (1-5):"))

#Find Minimum
if option == 1:
min_number = numbers[0]
for number in numbers:
if number < min_number:
min_number = number

print(f"The minimum number is {min_number}.")

#Find Maximum
elif option == 2:

max_number = numbers[0]
for number in numbers:
if number > max_number:
max_number = number

print(f"The maximum number is {max_number}.")

#Search for a number
elif option == 3:

target = int(input("Enter a number: "))

def linear_search(data, target):
for i in range(len(data)):
if data[i] == target:
return i
return -1

result = linear_search(numbers, target)
if result != -1:
print(f"Found at index {result}")
elif result == -1:
print(f"{target} not found")

#Sort the List
elif option == 4:

swapped = True

while swapped:
swapped = False

n = len(numbers)

for index in range(n-1):
if numbers[index] > numbers[index + 1]:
numbers[index], numbers[index + 1 ] = (numbers[index+ 1], numbers[index])

swapped = True

print(f"Sorted list: {numbers}")

#Quit Loop

elif option == 5:
print("Quitting Number Cruncher")
break
6 changes: 6 additions & 0 deletions week-5/warmup1.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#Calculating the sum of all integers from 1 to 100
sum_of_integers = 0
for num in range(1,101):
sum_of_integers += num

print (f"The sum of 1 to 100 is {sum_of_integers}.")
15 changes: 15 additions & 0 deletions week-5/warmup2.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
while True:
user_input = input("Enter a positive integer: ")

if user_input.isdigit() and int(user_input) > 0:
print(f"Got it: {user_input}")
break

else:
print("That's not a positive integer. Try again. \n")






Loading