migrate to git.charlotte.sh

This commit is contained in:
Charlotte Croce 2025-04-19 23:42:08 -04:00
commit fbd588721e
412 changed files with 13750 additions and 0 deletions

View file

@ -0,0 +1,10 @@
# This program reads two numbers and prints their sum:
a = int(input('Enter first number: '))
b = int(input('Enter second number: '))
c = int(input('Enter third number: '))
print(a + b + c)
# Can you change it so it can read and sum three numbers?

View file

@ -0,0 +1,5 @@
# Get the user's name
name = input('Enter your name:\n')
# Print hello statement
print("Hello, " + name + "!")

View file

@ -0,0 +1,7 @@
# Read an integer:
number = int(input('Enter a number:\n'))
# Print output for next and previous that matches the instructions
print("The next number for the number " + str(number) + " is " + str(number + 1))
print("The previous number for the number " + str(number) + " is " + str(number - 1))

View file

@ -0,0 +1,7 @@
# Read the numbers b and h like this:
base = float(input('Enter Base: '))
height = float(input('Enter Height: '))
# Print the result with print()
area = 0.5 * (base * height)
print(area)

View file

@ -0,0 +1,7 @@
# Read the numbers like this:
num_students = int(input("Number of students: "))
num_apples = int(input("Number of apples: "))
# Print the result with print()
print(num_apples // num_students)
print(num_apples % num_students)

View file

@ -0,0 +1,9 @@
# Read an integer:
seconds_past_midnight = int(input())
full_hours_past_midnight = (seconds_past_midnight // 3600) % 24
full_minutes_past_midnight = (seconds_past_midnight // 60) % 1440
print (full_hours_past_midnight, full_minutes_past_midnight)

View file

@ -0,0 +1,11 @@
# Input the data
cupcake_dollars = int(input())
cupcake_cents = int(input())
num_cupcakes = int(input())
# Your code here
total_cost_cents = (((cupcake_dollars * 100) + cupcake_cents) * num_cupcakes)
total_cost_dollars = total_cost_cents // 100
total_cost_cents = total_cost_cents % 100
print(total_cost_dollars, total_cost_cents)