Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a short program Open the IDLE, and using your lectures slides, starting from lecture 4, write a program that asks the user a number

Write a short program

Open the IDLE, and using your lectures slides, starting from lecture 4, write a program that asks the user a number as input (remember to use eval) and computes the square root (before you must import math and then use sqrt as math.sqrt(number)). Then, print the result of the square root.

Add the program below:

Test the program for positive, negative and zero numbers. Then, say why it does not work with negative numbers:

Reply below:

If the program uses the power operator ** instead of sqrt, it will also work with negative numbers. Try this change. And say what kind of result you got:

Reply below:

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

Step: 3

blur-text-image

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

Hands On Database

Authors: Steve Conger

1st Edition

013610827X, 978-0136108276

More Books

Students also viewed these Databases questions

Question

2. Show the trainees how to do it without saying anything.

Answered: 1 week ago