Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Program 6 Write and test a program to accept list of numbers from user. The program will have a function to calculate the square of

Program 6

Write and test a program to accept list of numbers from user. The program will have a function to calculate the square of each number in the list and a list containing the square of each number in the list and a function to calculate and return the sum for all the numbers in the list

squareEach(nums) is a function that modifies the list by squaring each entry and returns the list of squares for each number in the list, nums is a list of numbers

sumList(nums) is a function to sum numbers in a list and return the sum; nums is a list of numbers

Remember that squaring a number means multiplying it by itself so if I pass you a 7, you need to return it as a 49 (7*7)

Test your program with a sequence holding 1,2,3,4,5,6,7,8 and returning a sequence 1,4,9,16,25,35,49,64

This is to be done with Python Code

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 Database Relational Model A Retrospective Review And Analysis

Authors: C. J. Date

1st Edition

0201612941, 978-0201612943

More Books

Students also viewed these Databases questions

Question

e. What are notable achievements of the group?

Answered: 1 week ago

Question

u = 5 j , v = 6 i Find the angle between the vectors.

Answered: 1 week ago