

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Community
Ask the community for help and clear up your study doubts
Discover the best universities in your country according to Docsity users
Free resources
Download our free guides on studying techniques, anxiety management strategies, and thesis advice from Docsity tutors
Hello this is a assignment from the professor , everything is correct.
Typology: Assignments
1 / 3
This page cannot be seen from the preview
Don't miss anything!
5, 1, 8, 2].
numbers = [ 3 , 5 , 1 , 8 , 2 ]
max_value = max(numbers)
print("The maximum value in the list is:", max_value) The maximum value in the list is: 8
[10, 20, -2, 5, 30, 15].
numbers = [ 10 , 20 , - 2 , 5 , 30 , 15 ]
min_value = min(numbers)
print("The minimum value in the list is:", min_value) The minimum value in the list is: -
the list [1, 2, 3, 4, 5].
numbers = [ 1 , 2 , 3 , 4 , 5 ]
total_sum = sum(numbers)
print("The sum of the numbers in the list is:", total_sum) The sum of the numbers in the list is: 15
ascending and descending order.
numbers = [ 56 , 12 , 3 , 89 , 42 ]
ascending_order = sorted(numbers)
descending_order = sorted(numbers, reverse=True)
print("List in ascending order:", ascending_order) print("List in descending order:", descending_order) List in ascending order: [3, 12, 42, 56, 89] List in descending order: [89, 56, 42, 12, 3]
number -25.
number = - 25
absolute_value = abs(number)
print("The absolute value of the number is:", absolute_value) The absolute value of the number is: 25
integer.
number = 7.
rounded_number = round(number)
print("The rounded number is:", rounded_number) The rounded number is: 8
base = 5 exponent = 3
result = pow(base, exponent)
print("5 raised to the power of 3 is:", result) 5 raised to the power of 3 is: 125