Exercises Center of Atmospheric Sciences, UNAM August 24, 2016
NAND Make function that computes the NAND. It should receive two booleans and return one more boolean. logical operators A and B, A or B, not(a)
XOR Make function that computes the Exclusive or. It should receive two booleans and return one more boolean. logical operators A and B, A or B, not(a)
Three inputs Make function that computes A or (B and C). It should receive three booleans and return one more boolean. logical operators A and B, A or B, not(a)
Math packages 1 A function that receives a list and computes the factorial number of each value inside the list. The function should return a list with all the factorial numbers. How to import the package: import math acos (x) asin (x) atan (x) atan2 (x, y) ceil (x) cos (x) cosh (x) exp (x) fabs (x) floor (x) fmod (x, y) frexp (x) ldexp (x, y) log (x) log10 (x) modf (x) pow (x, y) sin (x) sinh (x) sqrt (x) tan (x) tanh (x) ATTRIBUTES math.pi pi e
Math packages 1 A function that receives a list and computes the factorial number of each value inside the list. The function should return a list with all the factorial numbers. 2 A function that receives the radius of a circle and returns the area of a circle. How to import the package: import math acos (x) asin (x) atan (x) atan2 (x, y) ceil (x) cos (x) cosh (x) exp (x) fabs (x) floor (x) fmod (x, y) frexp (x) ldexp (x, y) log (x) log10 (x) modf (x) pow (x, y) sin (x) sinh (x) sqrt (x) tan (x) tanh (x) ATTRIBUTES math.pi pi e
Math packages 1 A function that receives a list and computes the factorial number of each value inside the list. The function should return a list with all the factorial numbers. 2 A function that receives the radius of a circle and returns the area of a circle. 3 A function that receives the radius of a circle and returns the volume of a sphere. How to import the package: import math acos (x) asin (x) atan (x) atan2 (x, y) ceil (x) cos (x) cosh (x) exp (x) fabs (x) floor (x) fmod (x, y) frexp (x) ldexp (x, y) log (x) log10 (x) modf (x) pow (x, y) sin (x) sinh (x) sqrt (x) tan (x) tanh (x) ATTRIBUTES math.pi pi e
Math packages 1 A function that receives a list and computes the factorial number of each value inside the list. The function should return a list with all the factorial numbers. 2 A function that receives the radius of a circle and returns the area of a circle. 3 A function that receives the radius of a circle and returns the volume of a sphere. 4 A function that receives a list of numbers and computes the sine for each of them. How to import the package: import math acos (x) asin (x) atan (x) atan2 (x, y) ceil (x) cos (x) cosh (x) exp (x) fabs (x) floor (x) fmod (x, y) frexp (x) ldexp (x, y) log (x) log10 (x) modf (x) pow (x, y) sin (x) sinh (x) sqrt (x) tan (x) tanh (x) ATTRIBUTES math.pi pi e
Functions of a string https://docs.python.org/3/library/stdtypes.html#str.split 1 A function that receives a string and returns a string with all upper case letters. How to use the functions: mys = sopas perico mys.upper() index isalnum isdecimal islower isupper lower replace swapcase split isalpha isdigit isnumeric join lstrip strip upper
Functions of a string https://docs.python.org/3/library/stdtypes.html#str.split 1 A function that receives a string and returns a string with all upper case letters. 2 A function that receives a string with words separated by, and returns a list with each word in a cel. How to use the functions: mys = sopas perico mys.upper() index isalnum isdecimal islower isupper lower replace swapcase split isalpha isdigit isnumeric join lstrip strip upper
Functions of a string https://docs.python.org/3/library/stdtypes.html#str.split 1 A function that receives a string and returns a string with all upper case letters. 2 A function that receives a string with words separated by, and returns a list with each word in a cel. 3 A function that receives a string with words and numbers separated by, and returns a list with all the numbers in that list of words. How to use the functions: mys = sopas perico mys.upper() index isalnum isdecimal islower isupper lower replace swapcase split isalpha isdigit isnumeric join lstrip strip upper