Answers for "simple floating point example python"

1

simple floating point example python

float_number = float(12)

print(float_number)
# Python code to demonstrate float values.

print(1.7e308)

# greater than 1.8 * 10^308
# will print 'inf'
print(1.82e308)
########
float_string = float("12")

print(float_string)
#########
answer  =  round(12.2 + 14.6, 1)

student_input = input("What is 12.2 + 14.6?")

if float(student_input) == answer:
	print("You're right!")
else:
	print("The correct answer to 12.2 + 14.6 is", answer, ".")
Posted by: Guest on October-11-2021

Code answers related to "simple floating point example python"

Python Answers by Framework

Browse Popular Code Answers by Language