Modify and complete the function asn2

Assignment Help Business Management
Reference no: EM132265546

1. Complete the function asn2_1() so it prints the string that is passed to it as a parameter.

2. Modify and complete the function asn2_2() so it accepts one parameter-a list of numbers-and returns the average (rounded to 2 decimal places) of the numbers in the list. For full credit, use a loop to calculate the average of the numbers in the list.

3. Add a new function, asn2_3(), that draws a rectangle. The function should take five parameters: a turtle, the length of the horizontal side, the length of the vertical side, the x location of the bottom left corner, and the y location of the bottom left corner.

4. Complete the function main() to do the following:

a. Prompt the user for a string then call asn2_1() with that string as the argument; print the string in asn2_1().

b. You are given two lists, num1 and num2. Use asn2_2() to calculate their averages, then print those averages (calculate the average of each list using asn2_2() but print them in main()). c. Use asn2_3() to draw different-sized rectangles at locations (-150, 150), (-150, -150), (150, 150), (150, -150)

import turtle

def asn2_1(s):

'''Prints string s'''

pass #This statement does nothing - you can delete it or leave it

def asn2_2():

'''

Add a parameter - that parameter will be a list of numbers

Return the average of the list

'''

pass #This statement does nothing - you can delete it or leave it

#Add function asn2_3() to draw rectangles

'''

asn2_3 takes the following parameters:

a turtle and 4 integers; the integers are

the length of horizontal side, the length of vertical side,

x position of lower left corner, y position of lower left corner

'''

def main():

#Get a string from the user; use asn2_1() to print it

nums1 = [17, 12, 42, 11, 19] #This list will be sent to asn2_2()

nums2 = [110, 212, 411, 256, 119, 57, 98] #This will be sent to asn2_2()

#Get the average of nums1 by sending it to asn2_2()

#Print the average of nums1

#Get the average of nums2 by sending it to asn2_2()

#Print the average of nums2

wn = turtle.Screen() j

jacinda = turtle.Turtle()

#Use asn2_3() to draw four rectangles, using jacinda, as...

#...specified in the specs

main()

Reference no: EM132265546

Questions Cloud

What was the security breach in the scenario : From a security perspective, would you use your social security number in advertising? What was the security breach in the scenario?
Fill in the gant chart based on conditions : Fill in the Gant chart based on these conditions: (P, V, and context switch operations are instantaneous).Process P1 starts at time 0; P2 at time 3
Who were its major leaders and other influential members : Public source websites are defined as websites that allow members from the public to add content regardless of credentials or qualifications.
How KPI and Artificial intelligence have helped : Need content on atleast 4 mobile apps, how KPI and Artificial intelligence have helped them to build. Need around 15-16 slides apart from the intro.
Modify and complete the function asn2 : 1. Complete the function asn2_1() so it prints the string that is passed to it as a parameter.
What are the three parameters needed in the goal seek : What are the three parameters needed in the Goal Seek section of What-if Analysis? Explain each of them and what they do.
Topic of net neutrality : Conduct a SWOT analysis by analyzing the strengths, weaknesses, application opportunities, and threats from competitors of the chosen topic.
What are main processes involved in project time management : What are the main processes involved in project time management? In your words please describe them to help students in high school to perform their final.
Identify and explain security and counter-terrorism measures : Identify and explain security and counter-terrorism measures in relation to your selected type of terrorism.

Reviews

Write a Review

Business Management Questions & Answers

  Caselet on michael porter’s value chain management

The assignment in management is a two part assignment dealing 1.Theory of function of management. 2. Operations and Controlling.

  Mountain man brewing company

Mountain Man Brewing, a family owned business where Chris Prangel, the son of the president joins. Due to increase in the preference for light beer drinkers, Chris Prangel wants to introduce light beer version in Mountain Man. An analysis into the la..

  Mountain man brewing company

Mountain Man Brewing, a family owned business where Chris Prangel, the son of the president joins. An analysis into the launch of Mountain Man Light over the present Mountain Man Lager.

  Analysis of the case using the doing ethics technique

Analysis of the case using the Doing Ethics Technique (DET). Analysis of the ethical issue(s) from the perspective of an ICT professional, using the ACS Code of  Conduct and properly relating clauses from the ACS Code of Conduct to the ethical issue.

  Affiliations and partnerships

Affiliations and partnerships are frequently used to reach a larger local audience? Which options stand to avail for the Hotel manager and what problems do these pose.

  Innovation-friendly regulations

What influence (if any) can organizations exercise to encourage ‘innovation-friendly' regulations?

  Effect of regional and corporate cultural issues

Present your findings as a group powerpoint with an audio file. In addition individually write up your own conclusions as to the effects of regional cultural issues on the corporate organisational culture of this multinational company as it conducts ..

  Structure of business plan

This assignment shows a structure of business plan. The task is to write a business plane about a Diet Shop.

  Identify the purposes of different types of organisations

Identify the purposes of different types of organisations.

  Entrepreneur case study for analysis

Entrepreneur Case Study for Analysis. Analyze Robin Wolaner's suitability to be an entrepreneur

  Forecasting and business analysis

This problem requires you to apply your cross-sectional analysis skills to a real cross-sectional data set with the goal of answering a specific research question.

  Educational instructional leadership

Prepare a major handout on the key principles of instructional leadership

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd