Question: 1) Use for loops to compute the following expression: 1 1 1 + + + + 5 + + Here a sample run: Part
1) Use for loops to compute the following expression: 1 1 1 + + + + 5 + + Here a sample run: Part 01: 24.00 Round the sum to two decimal places using formatted string. 2) Use while loops to perform the following steps: a. Prompt the user to input two integers: firstNum and secondNum. If the secondNum is smaller than firstNum, swap the numbers. b. Output all odd numbers between firstNum and secondNum. c. Output the sum of the square of the odd numbers between firstNum and secondNum. d. Output the odd numbers between firstNum and secondNum, and their squares. Submit one single file. Save the file as a text file (.txt) Part 02: Enter first number Enter second number 7 Odd integers between 3 and 7 are: 357 5 25 7 49 + Sum of the squares of odd integers between 3 and 7 = 83 Odd integers and their square between 3 and 7 are: 39 624 + 625
Step by Step Solution
There are 3 Steps involved in it
Heres the Python code for both parts of your question mainpy Part 01 Initialize the sum sumexpressio... View full answer
Get step-by-step solutions from verified subject matter experts
