Modify and complete the function

Assignment Help Business Management
Reference no: EM132252807

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: EM132252807

Questions Cloud

Describe four wireless technologies-standards : Describe what each one does and briefly how it works? How is each one different from the other standards? Why would you use one over the other?
Discuss about the evolving workplace technologies : Determine and Discuss about the evolving workplace technologies and influence of social media.
Prepare the applicable presentation on hand hygiene : Chosen topic: Hand hygiene, Select one of the following options for delivery and prepare the applicable presentation: PowerPoint presentation.
World trade organization prohibits the practice of dumping : To promote fair trade, the World Trade Organization prohibits the practice of dumping.
Modify and complete the function : 1. Complete the function asn2_1() so it prints the string that is passed to it as a parameter.
Compare and contrast the design and management : Connection between design and management of supply chains and its success has been noticed in supply chains - Compare and contrast the design and management
Training and development in banking sector : Training and Development in Banking Sector
Discuss article related to healthcare marketing innovations : Choose an article that is current(not older than 6 months) and is related to healthcare marketing innovations, health care marketing technology advances.
Identify what techniques you can implement to improve : Identify what techniques you can implement to improve the likelihood that your communications will be received and understood as you intended.

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