Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I want you just to correct my code, do not write new just fix the problems - do not use elif, only if-else - make

I want you just to correct my code, do not write new just fix the problems

- do not use elif, only if-else

- make the alignment and formating exactly the same as the sample run, you can see that the output is indented below the input maybe you will need to use (%d, %s)

- also in my code there is a problem if I write -10000000 the output will be negative not negative large as the sample run

image text in transcribed

number= float(input("Enter floating point number:"))

if number == 0: output ="Zero" else: if number > 0: output ="positive" else: output="negative" if abs(number) 10000000: output= output + "large" print(output)

Exercise# 2: Write a program that reads a floating-point number and prints "zero" if the number is zero. Otherwise, print "positive" or "negative". Add "small" if the absolute value of the number is less than 1, or "large" if it exceeds 1,000,000. sample run sample run sample run sample run Enter floating point number: 0 Enter floating point number: -10000000 Enter floating point number: 0.7 Enter floating point number: 10.7 zero negative large positive small positive In [17]: 5 1 %%code ex02 2 # YOUR CODE HERE 3 number= float(input("Enter floating point number:")) 4 if number == @: 6 output = "Zero" 7 else: 8 if number> : 9 output ="positive" 10 else: 11 output="negative" 12 13 if abs(number) 10000000: 16 output= output + "large" 17 print (output)

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

Harness The Power Of Big Data The IBM Big Data Platform

Authors: Paul Zikopoulos, David Corrigan James Giles Thomas Deutsch Krishnan Parasuraman Dirk DeRoos Paul Zikopoulos

1st Edition

0071808183, 9780071808187

More Books

Students also viewed these Databases questions

Question

please dont use chat gpt or other AI 3 0 5 .

Answered: 1 week ago

Question

What is the relationship between time, risk and money?

Answered: 1 week ago