Write a program that reads a list of integers, and outputs whether the list contains all multiples of 10, no multiples of 10, or mixed values. Define a function named is_list_mult10 that takes a list as a parameter, and returns a boolean that represents whether the list contains all multiples of ten. Define a function named is_list_no_mult10 that takes a list as a parameter and returns a boolean that represents whether the list contains no multiples of ten. Then, write a main program that takes an integer, representing the size of the list, followed by the list values. The first integer is not in the list. Ex: If the input is: 5 20 40 60 80 100 the output is: all multiples of 10

Respuesta :

The program is an illustration of lists

What are lists?

Lists are variables that are used to hold multiple values

The main program

The program written in Python, where comments are used to explain each line is as follows:

#This defines the is_list_no_mult10 function

def  is_list_no_mult10(myList):

   #This iterates through the list

   for i in range(1,myList[0]):

       #This returns false, if the list contains a value that is not a multiple of 10

       if myList[i]%10 != 0:

           return False

           break

   #This returns true, if all the list elements are multiples of 10

   return True

#The main begins here

#This creates a list

myList = []

#This gets the length of the list

num = int(input())

#This appends the length into the list

myList.append(num)

#The following loop populates the list

for i in range(num):

   myList.append(int(input()))

#This prints if the list is all multiples of 10 or not    

if is_list_no_mult10(myList) == True:

   print("all multiples of 10")

else:

   print("not all multiples of 10")

Read more about python lists at:

https://brainly.com/question/15745784