Expecting the following program to print

Assignment Help Business Management
Reference no: EM131880357

The programmer was expecting the following program to print 200. What does it print instead? Why does it print what it does?

def proc(x):

x = 2*x*x

def main():

num = 10

proc(num)

print(num)

main() 

Need some help please. This is in python. I do not understand these two questions.

Is the following program legal since the variable x is used in two different places (proc and main)? Why or why not?

def proc(x):

return 2*x*x

def main():

x = 10

print(proc(x))

main()

Reference no: EM131880357

Questions Cloud

Develop an idea for a new csr endeavor for the organization : 21st Century Corporate Social Responsibility- Develop an idea for a new CSR endeavor for the organization based on the organization's mission and vision.
Computed using euclid algorithm : Write a program gcd.py that takes two integers x and y as command-line arguments and writes their greatest common divisor (gcd) computed
Determine types of inventories companies currently manage : Determine the types of inventories these companies currently manage and describe their essential inventory characteristics.
Describe the core values of the organization : Develop a vision statement for this organization. When developing a vision statement, be mindful of the module readings and lecture materials.
Expecting the following program to print : The programmer was expecting the following program to print 200. What does it print instead? Why does it print what it does?
What motivational techniques would you implement : If you were part of the management team at H-D, what motivational techniques would you implement to make these teams successful?
What are some key personality features that define you : How would you describe personality to a person who has no knowledge of the field of personality psychology? What are some key personality features that define.
What are the reasons for the research : Why did you select the articles? What are the reasons for the research? What concepts are discussed and how do they relate to your weekly class topic?
Store customer information for a mid-sized business : Suppose you are creating a program to store customer information for a mid-sized business.

Reviews

Write a Review

Business Management Questions & Answers

  Explain what is the product development process

Explain What is the product development process a school might use for designing and introducing a new course

  Examine three laws that support collective bargaining

Classify and examine three laws that support collective bargaining. Comprise and examine [showing relevance or applicability] at least one reference found in our text, along with a current web-based news item/magazine article about each.

  How should they divide this sum of money between them

Alternating offers game Barack and Joe can together implement a project that will jointly yield them a profit $100. How should they divide this sum of money between them?

  Human resource management-communication process

Please read and respond to the following case study from the text keeping in mind the below reflective statements.

  Board of directors duties and education program for

board of directors duties and education program for incoming membersneed a head start with this questionregarding the

  Write a paper addressing how well the change process worked

Write a paper addressing how well the change process worked. As a nurse leader, what would you have done differently to make the change more effective?

  Concept of patient centered care

What is the concept of patient centered care and the role of healthcare professionals and stakeholders have to ensure patient advocacy?

  Extend an offer to jane roberts

Do you support the decision to extend an offer to Jane Roberts? Explain your position. Recommend which type of job offer should be used by 3Cs for Jane Roberts. Explain why this is your choice. Also, discuss why you believe the other choices would ..

  Degree price discrimination

Give 2 example of third degree price discrimination. Can it be effective if there is reselling between groups? How does a car salesperson practice price discrimination and how does the ability discriminate correctlyaffect his earning?

  Fundamentals of customer service

Understand and explain the fundamentals of customer service

  Barriers to communication in different culturesexplain what

barriers to communication in different culturesexplain what are some of the barriers to communication between people of

  Types of alternative dispute resolution

Discuss the various types of alternative dispute resolution (ADR) and analyze which types of ADRs are regularly used in your workplace.

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