Quiz 10

                                                                                                                                    @PablO_CVi

Question 1: https://github.com/PablOCVi/Quiz-10/blob/master/q1.py

Create a function called findThrees that receives as a parameter a vector/array/list of numbers and returns the sum of all numbers in that vector/array/list that are evenly divisible by 3.

Question 2: https://github.com/PablOCVi/Quiz-10/blob/master/q2.py

Create a function called dotProduct that receives two vectors/arrays/lists of numbers (say v1 and v2). The function returns what is the dot product of the two vectors/arrays/lists.

 

Note1: If using vectors/lists, you must check that both vectors are the same size. If not, your function should print an error message (“Not same size vectors”) and return -1
Note2: If using arrays, you need to pass a third parameter which is the size of the arrays, you can assume both arrays are that same size.

CC BY 4.0 Quiz 10 by Pablo is licensed under a Creative Commons Attribution 4.0 International License.

Comments are closed.