assign1.py

# assign1.py - Samantha Danilowski > s1 = > s2 = > s1 2 s2 >...

• Lab Report
• 1

This preview shows page 1 out of 1 page.

Samantha Danilowski >>> s1 = '&' >>> s2 = '#' >>> s1 * 2 + s2 '&&#' >>> s2 * 2 + s1 '##&' >>> s1 * 2 + s2 + s1 * 2 + s2 '&&#&&#' >>> s1 * 10 '&&&&&&&&&&' >>> s1 * 2 + s2 * 2 + s1 * 2 + s2 * 2 + s1 * 2 + s2 * 2 '&&##&&##&&##' >>> s1 * 5 + s2 * 5 + s1 * 5 + s2 * 5 + s1 * 5 + s2 * 5 '&&&&&#####&&&&&#####&&&&&#####' price = float(input ("Enter a price (> 0): ")) quantity = float(input ("Enter a quantity: ")) if (price < 0 or quantity < 0): print ("invalid amount entered") else: print ("The total price is: \$", price * quantity) ======= RESTART: /Users/samanthadanilowski/Documents/price:quantity.py ======= Enter a price (> 0): 3.3 Enter a quantity: 5 The total price is: \$ 16.5 >>> ======= RESTART: /Users/samanthadanilowski/Documents/price:quantity.py ======= Enter a price (> 0): -1 Enter a quantity: 5
You've reached the end of this preview.
• Fall '10
• Schafer

{[ snackBarMessage ]}

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern