
# python practice exam

1. write a program that produces the following output

 NO PARKING
2:00 - 6:00 a.m.

# Answer

print('  NO PARKING\n2:00 - 6:00 a.m.')






2. Complete a program that reads four values from input and stores the values in variables first_name, generic_location, whole_number, and plural_noun. The program then uses the input values to output a short story. The first input statement is provided in the code as an example.


first_name = input()


generic_location = input()
whole_number = input()
plural_noun = input()


# Output a short story using the four input values. Do not modify the code below.
print(first_name, 'went to', generic_location, 'to buy', whole_number, 'different types of', plural_noun)

# Answer

James
store
2
apples




3. converting to dollars

# Read the number of quarters, dimes, nickels, and pennies

quarters = int(input())
dimes = int(input())
nickels = int(input())
pennies = int(input())

# Calculate total amount in cents

total_cents = (quarters * 25) + (dimes * 10) + (nickels * 5) + pennies

# Convert to dollars (as a float)
dollars = total_cents / 100.0

# Output the amount formatted to two decimal places

print(f'Amount: ${dollars:.2f}')


4. miles per gallon

# gas mileage: miles/gallon and cost of gas dollars/gallon

miles_per_gallon = float(input())
dollars_per_gallon = float(input())

# gallons each distance
gallons_20 = 20 / miles_per_gallon
gallons_75 = 75 / miles_per_gallon
gallons_500 = 500 / miles_per_gallon

# total each distance
cost_20 = gallons_20 * dollars_per_gallon
cost_75 = gallons_75 * dollars_per_gallon
cost_500 = gallons_500 * dollars_per_gallon

# costs formatted two decimal places
print(f'{cost_20:.2f} {cost_75:.2f} {cost_500:.2f}')



5. printing arrow

base_char = input()
head_char = input()

row1 = '      ' + head_char
row2 = base_char * 6 + head_char * 2
row3 = base_char * 6 + head_char * 3

print(row1)
print(row2)
print(row3)
print(row2)
print(row1)

# inputs *, #
