Question: 2 . Write a Python program to create a list. ( named YourName _ SID _ Lab 7 b . py ) : - Create

2. Write a Python program to create a list. ( named YourName_SID_Lab7b.py):
- Create an empty list named mydList to store some elements:Ask user to input an element and store it in the mydList in sequentially;Every time you ask, tell the user which element is being input next;The user completes the input when '\( Q \)' or '\( q \)' is entered;Display the input values on a single line;Find the sum and the total number of odd integers in the list.
(Hint: use while loop for user input and for loop for output display)
Sample Program Output
CCIT4020 Laboratory 7: Section 2
```
Input the elements to be stored in sequentially ...
Enter the 1-th element; enter 'Q'/'q' when completed: 3
Enter the 2-th element; enter 'Q'/'q' when completed: 4
Enter the 3-th element; enter 'Q'/'q' when completed: 8
Enter the 4-th element; enter 'Q'/'q' when completed: 1
Enter the 5-th element; enter 'Q'/'q' when completed: 60.99
Enter the 6-th element; enter 'Q'/'q' when completed: 1842
Enter the 7-th element; enter 'Q'/'q' when completed: -36
Enter the 8-th element; enter 'Q'/'q' when completed: 0.03
Enter the 9-th element; enter 'Q'/'q' when completed: q
```
The elements stored in mydList are:
348
The total sum of these elements is 1883.02 and the number of odd integers is 2.
2 . Write a Python program to create a list. (

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!