Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a Python program that evaluates y = sin(x) + sin(x2) for the 21 values of x in 0.0, 0.5, 1.0, 1.5, ... , 10.0.

Write a Python program that evaluates y = sin(x) + sin(x2) for the 21 values of x in 0.0, 0.5, 1.0, 1.5, ... , 10.0. The program should start by calling main. Then main call computeVals which returns a list containing the values of y. This list is then printed in a table with 7 columns. This printed should b e done in a function named display that is called from main. Use a formatted print utilizing a 7.2f format descriptor. The framework of the program is also included down below. image text in transcribedimage text in transcribed

Homework A-1: Write a Python program that evaluates y=sin(x)+sin(x2) for the 21 values of x in 0.0,0.5,1.0,1.5,,10.0. The program should start by calling main. Then main call computeVals which returns a list containing the values of y. This list is then printed in a table with 7 columns. This printed should be done in a function named display that is called from main. Use a formatted print utilizing a 7.2f format descriptor. - Here is what the output looks like. import math def display(lst): pass def computeVals(listx): pass def main(): listx = [.5*x for x in range (0,21)] listy = computeVals(listx) display(listy) main()

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

The Accidental Data Scientist

Authors: Amy Affelt

1st Edition

1573877077, 9781573877077

More Books

Students also viewed these Databases questions

Question

Describe what is meant by ethical behavior.

Answered: 1 week ago

Question

Know how to use reservations systems to inventory demand.

Answered: 1 week ago