Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

For the line with red highlight, I don't know what I did wrong with the code. I want to compare user's input with the decimal

For the line with red highlight, I don't know what I did wrong with the code. I want to compare user's input with the decimal value but apparently python doesn't want to accept my code...
image text in transcribed
7 fthis is a search ensine for astromomers to nit flisens can imput the mass of a star. then the print ( Welcome!' ) print ('Please input a mass value, Note: the mass value MuST be in golar unit'") while True: massinput = input (>:) Hcheck if user type in a number if Decimal (massInput) = False: print ('You must input a number! Please (ry again. ") else: if Deciaal (massInput) = Decimal (0.3) : print ('This is a not a red giant. Please input a rase value greater than 0.3 ) El if Decimal (mass Input) > Decimal (0.3) and Decimal (massInput) (8,0) : print ( Red Giants with sthal1 mass ( 8 solar mait) will prodice. (uPlanetary luNebulae, ') elif Decinal (massinput) > Decinal (8): print ('Red Ciants with seall friss (C 8 solar mass) will produce huType lutt (uSupernoyae:')

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

Securing SQL Server Protecting Your Database From Attackers

Authors: Denny Cherry

2nd Edition

1597499471, 978-1597499477

More Books

Students also viewed these Databases questions