Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

2 Question 2: Write a Series of Mathematical Functions (33 pts) Write the following three functions: addTwoNumbers(a,b), which takes as input two numbers a and

image text in transcribed

2 Question 2: Write a Series of Mathematical Functions (33 pts) Write the following three functions: addTwoNumbers(a,b), which takes as input two numbers a and b and returns the result a+b multiplyTwoNumbers(a,b), which takes as input two numbers a and b and returns the result a*b . calculate(a), which takes as input one number a and uses the above functions to return the result a2 + 2 3 Question 3: Test out map and filter (33 points) a) Write a function called longStrings(L) which given a list of strings L, returns a new list containing only the strings with length longer than 5. i.e.: longStrings(['a,'b','abcde','abcdef']) -> [abcdef'] b) Write a function doubleStrings(L) which given a list of strings L, returns a new list of the same strings but doubled. i.e.: doubleStrings(['a','b','cc?]) -> ['aa', 'bb', 'cccc'] - Again, please submit this home- work as a single file containing all functions, called hw1.py

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

SQL For Data Science Data Cleaning Wrangling And Analytics With Relational Databases

Authors: Antonio Badia

1st Edition

3030575918, 978-3030575915

More Books

Students also viewed these Databases questions

Question

LO4 Specify how to design a training program for adult learners.

Answered: 1 week ago