How do i get .0 in front of the outputted square root? /u/Disastrous-Jello1992 Python Education

from math import sqrt # Write your solution here while True: number=float(input("Please type in a number:")) if number<0: print("Invalid number!") if number>0: print(sqrt(number)) if number==0: break print("Exiting...") i get answer in integer once i write a number 16 to 4 But i want it 4.0 

submitted by /u/Disastrous-Jello1992
[link] [comments]

​r/learnpython from math import sqrt # Write your solution here while True: number=float(input(“Please type in a number:”)) if number<0: print(“Invalid number!”) if number>0: print(sqrt(number)) if number==0: break print(“Exiting…”) i get answer in integer once i write a number 16 to 4 But i want it 4.0 submitted by /u/Disastrous-Jello1992 [link] [comments] 

from math import sqrt # Write your solution here while True: number=float(input("Please type in a number:")) if number<0: print("Invalid number!") if number>0: print(sqrt(number)) if number==0: break print("Exiting...") i get answer in integer once i write a number 16 to 4 But i want it 4.0 

submitted by /u/Disastrous-Jello1992
[link] [comments] 

Leave a Reply

Your email address will not be published. Required fields are marked *