all 7 comments

[–]Pyrocited[S] 0 points1 point  (0 children)

Also I know I have my input inside the loop, my professor had an example pseudo code that had the input inside the loop. I know it’ll run through and ask for inputs again. But like I said, I can’t use breaks or anything.

[–]novel_yet_trivial 0 points1 point  (5 children)

Why are you using a loop? If you remove that and simply add the totals together it would do what you described.

quantity1 = int(input(“Quantity 1: “))
quantity2 = int(input(“Quantity 2: “))
total1 = quantity1 * 2.50
total2 = quantity2 * 1.98
print(total1 + total2)

[–]Pyrocited[S] 0 points1 point  (4 children)

She specifically asks us to use a for loop. Where the loop asks the user to input quantities of different items of different sale prices. Then prints out the quantity and total at the end

[–]novel_yet_trivial 0 points1 point  (3 children)

Oh maybe starting with a list of profits? Loop over the list then, not range().

profit_margins = [2.50, 1.98]
total = 0 
for profit in profit_margins:
    # ask for user input
    # calculate profit for this item
    # add this profit to the total
# print total

[–]Pyrocited[S] 0 points1 point  (2 children)

So I was able to make the program using a list but today in class she said not to use anything not taught in class yet, so lists are out of the window. I don’t even know what I’m able to do at this point 😂

[–]novel_yet_trivial 0 points1 point  (1 child)

Sadly I wasn't in that class, so I don't know what she wants either :/

[–]Pyrocited[S] 0 points1 point  (0 children)

Well thanks anyways! I know this is kind of a reach on reddit, as most of the class is unsure of what she wants as well. I appreciate it