items = int(input("Number of items: "))
# while loop checks to make sure the user has input a number that is zero or higher
while items < 0:
    print("Invalid number of items!")
    items = int(input("Number of items: "))
# if the number is valid the price is added together in a for loop the length of the number of item input
else:
    price = 0
    for i in range(0, items):
        price = price + float(input("Price of item: "))
print("Total price of " + str(items) + " is $" + str(price))
445d6f36838b62d26f5460144d2dd9d4db07a008
<mask token>

<mask token>
while items < 0:
    print('Invalid number of items!')
    items = int(input('Number of items: '))
else:
    price = 0
    for i in range(0, items):
        price = price + float(input('Price of item: '))
print('Total price of ' + str(items) + ' is $' + str(price))

items = int(input('Number of items: '))
while items < 0:
    print('Invalid number of items!')
    items = int(input('Number of items: '))
else:
    price = 0
    for i in range(0, items):
        price = price + float(input('Price of item: '))
print('Total price of ' + str(items) + ' is $' + str(price))

items = int(input("Number of items: "))
# while loop checks to make sure the user has input a number that is zero or higher
while items < 0:
    print("Invalid number of items!")
    items = int(input("Number of items: "))
# if the number is valid the price is added together in a for loop the length of the number of item input
else:
    price = 0
    for i in range(0, items):
        price = price + float(input("Price of item: "))
print("Total price of " + str(items) + " is $" + str(price))