Campus Life
Eco Explorer
Fashion Files
Movie Magic
100

A student’s GPA is 3.8. What data type would be a good fit for this data?

What is double

100

A clothing store calculates the total price of an order, which comes out to $49.756. You, the cashier rounds this amount to the nearest whole number before charging the customer. How would you write a Python statement to do it for you?

round(order_price)

100

shoe_size = input("Enter your shoe size: ")

If the customer enters 9, what will be the data type of shoe_size?

string

100

To advertise your indie film, you need to pay the local newspaper per character in your film title. Write code that counts the number of characters in your film title.

len(title)

200

If a student has at least a 3.5 GPA, they make the Dean’s List. Write code that prints "Dean’s List" if the gpa is 3.5 or higher.

if gpa >= 3.5:

    print("Dean’s List")

200

Plot, using matplotlib, CO₂ levels [300, 320, 340, 360]  on the Y-axis over the years [2000, 2005, 2010, 2015] on the X-axis.

plt.plot(years, co2_levels)

200

product_code = "FW23-JEANS-BLK-12345"

From the product code, write code that extracts the color code ("BLK").

What is product_code.split("-")[2]

200

You have a movie release date stored as:

release_date = "2023-07-21"

Extract the release year from this string, using slicing.

year = release_date[:4]

300

A student’s email is stored as email = "rushsangs@northeastern.edu". Write code to extract the student’s username (the part before @).

What is email.split("@")[0]

300

A climate scientist wants to record temperature readings every 5 years from the year 2000 to 2020. Write a for loop using range() to print these years.

for year in range(2000, 2021, 5):

    print(year)

300

A clothing store offers a discount if a customer buys more than 3 items or if their total purchase exceeds $100. Write a logical expression in Python to check if a customer qualifies for the discount. Use num_items for the number of items and total_price for the total purchase amount.

if num_items > 3 or total_price > 100:

    print("Discount Applied!")

300

A movie theater offers discounted tickets to seniors (age 65+) and children (age 12 or below). Write code that prints “Discount Applied” if the customer qualifies.

if age >= 65 or age <= 12:

    print("Discount Applied")

else:

    print("Full Price")

400

A student takes 3 classes per semester. Courses are an average of 3 credits. How many semesters will they take to graduate if they need at least 120 credits?

if total_credits % (classes_per_semester * credits_per_class) == 0:
    semesters = total_credits / (classes_per_semester * credits_per_class)

else:

semesters = total_credits / (classes_per_semester * credits_per_class) + 1

400

The following code is supposed to print the names of renewable energy sources but has a bug. Find and fix the error.

energy_sources = ["Solar", "Wind", "Hydro", "Geothermal"]
for i in range(energy_sources):
     print(energy_sources[i])

Iteration is messed up -- the range function is incorrectly used. Change the loop to simply iterate by value:

for i in energy_sources:

400

A fashion retailer offers a limited-time discount on jackets. The discount applies only if the jacket is in stock and the customer has a membership.

Given the boolean variables:
    •    in_stock (whether the jacket is available)
    •    has_membership (whether the customer is a member)

What boolean expression would determine if the customer gets the discount?

if in_stock and has_membership

400

From our star wars characters list, can you write code that counts the number of digits a character has on average.

characters = ["C3PO", "CT-7567 \"Rex\"", "BB-8"....]

Rush should probably put this in code...

500

A student wants to save $1,000 for a study abroad trip. They can save $150 each month. Write code that shows them how much they've saved up as each month passes, and then finally how many months it takes them.

goal = 1000

savings = 0

months = 0

while savings < goal:
    savings += 150
    months += 1
    print("Month:", months, " Amount Saved:", savings)

print("Total months:", months)

500

A company is considered eco-friendly if it uses only renewable energy sources. If we have a list of renewable energy sources, how would you check if a company's energy sources are renewable?

Rush should probably solve this...
500

You are running a fashion show where 10 models will walk down the runway, one at a time, wearing an outfit designed by one of 10 designers. You have two lists, models and designers. Write code that makes announcements like this:
"Number X we have our model <model's name> walking up wearing an outfit designed by <designer's name>!"

Rush should solve this...

500

Your movie theater has only 20 seats. Write code that asks a customer how many tickets they want to buy, repeatedly, until tickets run out. If a customer asks for more tickets than available, print a message saying they cannot buy these many tickets.

Rush should solve this...

M
e
n
u