Draw square function from the shapes module

Assignment Help Basic Computer Science
Reference no: EM131928937

Below are 2 out of the 20 questions that I am struggling with. Any assistance would be appreciated.

1) Consider the code snippet named shapes.py. A statement to call the draw_square function from the shapes module, passing an argument of 3 would be _______________.

cr = '#'

import shapes

def draw_square(size):

for h in range(size):

for w in range(size):

print(cr, end='')

print()

def draw_rect(height, width):

for h in range(height):

for w in range(width):

print(cr, end='')

print()

a) draw_rect(3)

b) draw_square(3.0)

c) shapes.draw_square(3)

d) The program throws an error

2) The following code uses functions defined in my_funcs.py. Complete the import statement at the top of the program.

____________________

a = 3

print('a! = ', factorial(a))

print('log(a) = ',log(a))

a) import factorial, squared

b) import factorial, log

c) from my_funcs import factorial, log

d) from my_func import factorial log

Reference no: EM131928937

Questions Cloud

What steps can management take to make the teams cohesive : What steps can management take to make the teams cohesive? Evaluate the steps that are necessary in this scenario to create high performing teams.
Discuss the importance of theory guided nursing practice : Discuss the applicability and importance of theory guided nursing practice, including the discussion of their application of a major espoused theory
Calculate the maximum number of pins : You are required to calculate the maximum number of PINs that the thief may have to enter before correctly discovering the customer's PIN?
Evaluate the efficacy of the measures : Analyze the general transition of U.S. health laws based on criminal misconduct in health care to the creation of contract laws.
Draw square function from the shapes module : Consider the code snippet named shapes.py. A statement to call the draw_square function from the shapes module, passing an argument of 3 would be
Analyze the buying process for an online product : Research and analyze the buying process for an online product or service, with which you (as a consumer) are familiar, from a business point of view.
Explain the significant ways that affects the demand curve : From the e-Activity, compare the primary individual factors that influence demand, and explain the significant ways in which each affects the demand curve.
What are the factors are required : What are the factors are required to decide how many APs are needed and where they should be placed for best performance in wireless communication?
A business situation that presents a legal and ethical issue : A description of at least two ethical theories under which the situation will be analyzed. A description of a business situation that presents a legal issue.

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Implement a program to solve the n-queens problem

Design and implement a program to solve the n-queens problem. Your program should prompt the user for the size of the board, search for a solution, and print the resulting board if a solution was found.

  Common types of policies for web services

What are the most common types of policies for Web services? 12.2 What are the main components of WS-Policy Framework?

  Explain the challenges and opportunities of an agile project

Explain the challenges and opportunities of an Agile project leader.

  Describe how upper is adjusted to allow simpler code to work

Describe how A_upper is adjusted to allow this simpler code to work. (Hint: A_upper requires to be adjusted because A_lower will be sign-extended.)

  Finding content of top of stack-call instruction is executed

Specify the content of PC, SP, and the top of the stack in the following situations: After the call instruction is executed.

  Six economic goals discussed in section

Review the six economic goals discussed in this section. Then, in a paragraph of at least five sentences, describe the goal you feel is the most important to a country and explain why you feel this way. Be sure to provide at least two logical reas..

  Implement national agricultural policies

Should the United States implement national agricultural policies and associated programs that require/promote/incentivize sustainable agricultural practices.

  Design an algorithm to perform a prefix computation

Design an algorithm to perform a prefix computation on an √n ×√n mesh in 3√n steps. Show that no other algorithm for this problem on this mesh has substantially better performance.

  Compare the performance of these compiled functions

Compare the performance of these compiled functions

  The fcc created a set of frequencies for walkie-talkie

The FCC created a set of frequencies for walkie-talkie radios. This set is called the family radio service and allows two radios to transmit up to a several-mile distance.

  Create an addition operator for the compound class

Create an addition operator for the compound class so that when you add two compounds, you get a new one. In the operator function, just print a string.

  Advancing call center logistics

Advancing Call Center Logistics

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