Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

PLEASE USE PYTHON, THIS IS CODEHS. IDK WHAT IS WRONG WITH MY CODE. THANKS IN ADVANCE & GOD BLESS :D Exercise 5.4.4: Square with Return

image text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedPLEASE USE PYTHON, THIS IS CODEHS. IDK WHAT IS WRONG WITH MY CODE. THANKS IN ADVANCE & GOD BLESS :D

Exercise 5.4.4: Square with Return Values points Write a function to square a number using return values. Squaring a number means multiplying it by itself. Then make several calls to that function in your start function to test it out. Your square function should only return a value, not print anything. For example a function call like x = square(5) should put the value 25 in x. Print out x to be sure your function returns the correct value. Note: Be sure to include comments for all functions that you use or create. 5.4.4: Square with Return values Save Submit + Continue RUN CODE TEST CASES ASSIGNMENT | DOCS | GRADE MORE Test Cases Check Code Expand All Minimize All 1 - def square(x): 2 square_X = X* X 3 return square_x 4 5 X = 8 6 print(square(x)) 7 8 X = 3 9 print (square(x)) le 11 X = 2 12 print(square(x)) Test Pass Message Great! You should define a function called square Great! Your function should return a value You should call your function square a few times Store the retum value so you can verify it is correct Your result: Exercise 5.4.5: Quadruple with Return Values Spoint Write a function called quadruple that quadruples a number and returns the result. Then make several calls to the quadruple function to test it out. For example, if you made a call like * = quadruple(3) then x should hold the value 12. Print the value of x to verify your function works correctly. Note: Be sure to include comments for all functions that you use or create. Save Submit + Continue RUN CODE TEST CASES ASSIGNMENT DOCS | GRADE MORE 5.4.5: Quadruple with Return 1 - def quadruple(x): quadruple_X = X* X *xx 3 return quadruple_x 4 5 y = 8 Test Cases Check Code Expand All Minimize All Test Pass Message Great! You should define a function called quadruple Your function should return a Great! value X You should call your function quadruple a few times Store the return value so you can verify it is correct

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_2

Step: 3

blur-text-image_3

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

Modern Database Management

Authors: Jeff Hoffer, Ramesh Venkataraman, Heikki Topi

12th edition

133544613, 978-0133544619

More Books

Students also viewed these Databases questions

Question

if your picture doesn't load what will appear

Answered: 1 week ago

Question

5. How would you describe your typical day at work?

Answered: 1 week ago

Question

1. What is Fog ?

Answered: 1 week ago

Question

How water vapour forms ?

Answered: 1 week ago

Question

What is Entrepreneur?

Answered: 1 week ago

Question

Which period is known as the chalolithic age ?

Answered: 1 week ago

Question

LO3 Name the seven categories of HR functions.

Answered: 1 week ago

Question

LO1 Understand human resource management and define human capital.

Answered: 1 week ago