Python_Assignment
Python_Assignment
Code:
Explanation:
1. The function `print_circum(radius)` calculates the circumference of a circle using the
formula 2πr.
2. The function is called three times with radii of 5, 10, and 15.
3. Outputs:
- For radius 5: Circumference = 31.42
- For radius 10: Circumference = 62.83
- For radius 15: Circumference = 94.25
Explanation:
1. The catalog includes three individual items with prices of 200.0, 400.0, and 600.0.
2. Combo packs include:
- Combo 1 (Item 1 + Item 2): 540.0 (10% discount)
- Combo 2 (Item 2 + Item 3): 900.0 (10% discount)
- Combo 3 (Item 1 + Item 3): 720.0 (10% discount)
3. The gift pack includes all three items with a 25% discount, priced at 900.0.
4. The function calculates prices dynamically using arithmetic expressions.
References:
Downey, A. B. (2012). Think Python: How to Think Like a Computer Scientist. Green Tea
Press.