PFP191_-_PE_-_SU_2023_Hola_Slot_4_284.webp
K

PFP191_-_PE_-_SU_2023_Hola_Slot_4_284.webp

Question 1: (2 marks)
The given file Q1.py already contains statements to input data for three integer variables named a, b, and c. You should write statements to print out the minimum number in three numbers.
Notes:
- Do not edit given statements in the main function
- You can create new functions if you see it is necessary.
Sample input and output:
Input: a3, b=7, c=6
After processing: min = 3
Output for marking:
OUTPUT:
3
Question 2: (3 marks)
The given file Q2.py already contains statements to input data for an integer variable named n. You should write statements to print out the sum of the primes less than n.
(Hint: A prime has only two divisors, 1 and itself. The primes start from 2)
Notes:
- Do not edit given statements in the main function
- You can create new functions if you see it is necessary.
Sample input and output:
Input: n = 7
After processing: 2+3+5 = 10
Output for marking:
OUTPUT:10
Question 3: (2 marks)
The given file Q3.py already contains statements to input data for the list and a variable x. You should write statements to print out the average of elements that are divisible by x in the list.
+ 80%
Zoom
Close
Chưa có bình luận nào.

Thông tin

Category
PFP191
Thêm bởi
Kurourushi89
Ngày thêm
Lượt xem
1,323
Lượt bình luận
0
Rating
0.00 star(s) 0 đánh giá

Image metadata

Filename
PFP191_-_PE_-_SU_2023_Hola_Slot_4_284.webp
File size
51.9 KB
Dimensions
1536px x 793px

Share this media

Back
Bên trên Bottom