Write a Python program to round every number of a given list of numbers and print the total sum multiplied by the length of the list

  • برمجة
  • برمجة بايثون

Write a Python program to round every number of a given list of numbers and print the total sum multiplied by the length of the list.

الأجوبة

nums = [22.4, 4.0, -16.22, -9.10, 11.00, -12.22, 14.20, -5.20, 17.50]
print("Original list: ", nums)
print("Result:")
lenght=len(nums)
print(sum(list(map(round,nums))* lenght)) 
هل كان المحتوى مفيد؟

تبحث عن مدرس اونلاين؟

محتاج مساعدة باختيار المدرس الافضل؟ تواصل مع فريقنا الان لمساعدتك بتأمين افضل مدرس
ماهو التخصص الذي تبحث عنه؟
اكتب هنا...