Spirit0327 / aarushg_2025

https://spirit0327.github.io/aarushg_2025/
Apache License 2.0
0 stars 0 forks source link

3.8 HW Submission Aarush Gowda #4

Open NeonMist27 opened 1 month ago

NeonMist27 commented 1 month ago

POPCORN HACK 3.8.1: nums = []

num_of_inputs = int(input("How many numbers do you want to add to the list? "))

for _ in range(num_of_inputs): number = int(input("Enter a number: ")) nums.append(number)

print("Numbers divisible by 2:") for num in nums: if num % 2 == 0: # Check divisibility by 2 print(num)

HACKS: 3.8.6 HOMEWORK HACK:

numbers = [1, 2, 3, 4, 5]

for number in numbers: print(number) 3.8.8 HOMEWORK HACK:

numbers = [1, 2, 3, 4, 5]

for number in numbers: if number == 3: continue
if number == 5: break print(number)