Form 4 - Computer
2023-2024
Mr. Peter
![](https://s3.amazonaws.com/media-p.slid.es/uploads/2214875/images/9811262/pasted-from-clipboard.png)
1
List Structure
2
3
![](https://s3.amazonaws.com/media-p.slid.es/uploads/1490014/images/9343467/pasted-from-clipboard.png)
![](https://s3.amazonaws.com/media-p.slid.es/uploads/2214875/images/10437733/pasted-from-clipboard.png)
While loop statement - Ex14_1
List all elements using len() function
Write a Python program that iterate each element in a provided List and print it.
elements = [ 1, 2, 3, 5, 10 ]
Code Provided
Expected outcome after your program executed
1
2
3
5
10
Print in the console
Save the file as "XX_YYYY_Ex14_1.py"
While loop statement - Ex14_2
List reversed elements
Write a Python program that iterate each element in a provided List and print it.
elements = [ 1, 2, 3, 5, 10 ]
Code Provided
Expected outcome after your program executed
10
5
3
2
1
Print in the console
Save the file as "XX_YYYY_Ex14_2.py"
While loop statement - Ex14_3
Save the file as "XX_YYYY_Ex14_3.py"
Product all values from the elements
Write a Python program that iterate each element in a provided List, and the calculate the product of each elements in the list.
elements = [ 1, 2, 3, 5, 10 ]
Code Provided
Expected outcome after your program executed
300
Print in the console
While loop statement - Ex14_4
Show all odd number of the list
Write a Python program that iterate each element in a provided List and print it if the element is not an even number.
elements = [ 1, 2, 3, 5, 10 ]
Code Provided
Expected outcome after your program executed
1
3
5
Print in the console
Save the file as "XX_YYYY_Ex14_4.py"
Python - List
By Mr Peter
Python - List
- 151