Write a program named program53py that imports the


Assignment 1:

- Add more comments as needed in each program to explain what your code is doing.
- Choose descriptive variable names in all programs.
- Before submitting this assignment, refer to the grading rubric to maximize your earned grade points.

1. Write a program named program71.py as follows. Follow instructions carefully to avoid point deductions.

In the main function:
- create an empty list named nums.
- use a loop to add 10 random integers, all in the range from 1-25, to the list.
- use another loop to display the numbers all on the same line, separated by a single space.
- sort the list.
- use another loop to display the sorted numbers all on the same line, separated by a single space.
- make a new list named start by slicing out the first 4 elements of the sorted nums list.
- print the start list.
- make a new list named finish by slicing out the final 5 elements of the sorted nums list.
- print the finish list.
- execute the odd_even function (defined next) with sorted nums as its sole argument.

Inside the odd_even function:
- process the list and output the number of even and odd elements.
- display the 6th element in the list.

Sample Output
10 11 10 18 23 3 11 25 23 15
3 10 10 11 11 15 18 23 23 25
[3, 10, 10, 11]
[15, 18, 23, 23, 25]
List had 3 evens and 7 odds

The 6th element in sorted nums is 15

Assignment 2:

- Write all lines of your pseudocode as comments immediately after your name and SPC ID# comment.
- Add more comments as needed in each program to explain what your code is doing.
- Choose descriptive variable names in all programs.
- Before submitting this assignment,

1. Write a program named program51.py that defines a value-returning function named cuber that returns both the surface area and volume of a cube. A cube is a rectangular prism with all sides equal. Prompt the user to enter the cube's side length from the keyboard in the main function and then call the cuber function. The main function should "catch" the values returned by cuber and display both the surface area and volume accurate to three decimal places.
SAMPLE OUTPUT
Enter side length of cube 2.5
Surface area is 37.500
Volume is 15.625

2. Write a program named program52.py that uses main and a void function named numbers that takes no arguments and does not return anything. The numbers function generates 5 random integers, each greater than 10 and less than 30 (duplicates are okay), and prints them all on one line separated by spaces. A loop is required for this, and the loop should also total up the integers so the sum can be displayed when the loop ends. The main function should call the numbers function.
SAMPLE OUTPUT
12 24 16 21 17
The total is 90

3. Create a custom Python module named tempconvert.py. This module must contain two functions: one that converts from Celsius to Fahrenheit and one that converts from Fahrenheit to Celsius. Write a program named program53.py that imports the tempconvert module. The program should prompt the user to specify the temperature and the scale, and then perform the appropriate conversion accurate to two decimal places.
SAMPLE OUTPUT 1
Enter the temperature to convert 37
Was that input Celsius or Fahrenheit?
Enter C or F C
In Fahrenheit, that is 98.60
SAMPLE OUTPUT 2
Enter the temperature to convert -40
Was that input Celsius or Fahrenheit?
Enter C or F F
In Celsius, that is -40.00

Solution Preview :

Prepared by a verified Expert
Basic Computer Science: Write a program named program53py that imports the
Reference No:- TGS01699081

Now Priced at $35 (50% Discount)

Recommended (99%)

Rated (4.3/5)