4. Write a function my_make_size 10(x), where x is an array and output is the first 10 elements of x if x has more than
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am
4. Write a function my_make_size 10(x), where x is an array and output is the first 10 elements of x if x has more than
5. Can you write my_make_size 10 without using if-statements (i.e., using only logical and array operations)? 6. Write a function my_letter_grader(percent), where grade is the string 'A+' if percent is greater than 97, 'A' if percent is greater than 93, 'A-'if percent is greater than 90, 'B+' if percent is greater than 87, 'B' if percent is greater than 83, 'B-' if percent is greater than 80, 'C+' if percent is greater than 77, 'C' if percent is greater than 73, 'C-'if percent is greater than 70, 'D+' if percent is greater than 67, 'D' if percent is greater than 63, 'D-' if percent is greater than 60, and 'F' for any percent less than 60. Grades exactly on the division should be included in the higher grade category.