Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

python Assignment #4 Create a new notebook with the name format: Lastname_HomeworkNumber. For example, CychB_HW 4 Create a markdown block in which you will describe

python

image text in transcribed

Assignment #4 Create a new notebook with the name format: Lastname_HomeworkNumber. For example, CychB_HW 4 Create a markdown block in which you will describe what the notebook does. 1. The equations for an ellipse are: x -a cos( $theta$), y-b sin( $Itheta$) $a$ is the major radius $b$ is the minor radius $Itheta$ is the angle a. Write a lambda function that returns $x$ and Sy$ given $a$, Sb$, and $itheta$. Assume that theta goes from 0 to 360. Remember that trig functions assume the arguments are in radians b. Plot your ellipse using matplotlib.pyplot (imported as plt). Use the %matplotlib nline magic command 2. Write a lambda function that returns the square of an input parameter $x$ a. Use map) to generate a list of squares for a sequence with 10 values b. Use filter) and the lambda function to generate a list of squares that are between 5 and 50. c. Use a list comprehension to generate the same list with only one line of code. 3. Create a Class, it should include at least 3 attributes and 3 methods. Be creative! Here are a few possibilities- Card, Deck, Planet, Phone Contact, Ocean, Student, Cellphone, Dog, Car a. Save your class in a module, import the module into your notebook b. Create 3 instances of your class, change the value of at least one attribute for one instance of your class c. Call all three of your methods- you can use any of the instances of your class

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_2

Step: 3

blur-text-image_3

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

More Books

Students also viewed these Databases questions

Question

Explain budgetary Control

Answered: 1 week ago

Question

Solve the integral:

Answered: 1 week ago

Question

What is meant by Non-programmed decision?

Answered: 1 week ago

Question

What are the different techniques used in decision making?

Answered: 1 week ago