Question: I Am New To Coding And Need Help Setting Up These Problems So If You Could Please Help With #(2-5). #2.) - nOdd(t) Write the
I Am New To Coding And Need Help Setting Up These Problems So If You Could Please Help With #(2-5).
#2.)
- nOdd(t)
Write the function nOdd that takes a tuple (t) and returns an integer, the number of odd integers in the tuple.
#3.
- overlap(a1, a2, b1, b2)
Write the function overlap that takes four integers a1, a2, b1, b2, defining two closed intervals [al, a2] and [b1, b2] of the real number line, and returns True if these two closed intervals overlap (even it at only one value) and False otherwise. If al > a2, then the interval (al, a2] is empty. If b1 > b2, then the interval [b1,b2] is empty. Both intervals are closed, so contain their endpoints.
#4.)
- isRightTri
Write the function isRightTri that takes three vertices of a triangle A in
2D, each vertex represented sing a tuple of two floats, and returns the Boolean True if A is a right triangle and False otherwise.
#5.)
- smallerThanIndex (L)
Write the function smallerThan Index that takes a list of integers and returns an integer, the nu integers in the list whose value is smaller than its index.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
