#Convert US measures to metric system measures
#Get an
Question
This is a program I am doing;
#Convert US measures to metric system measures
#Get an
input from user (William) to convert miles to kilometers
#Store the input value in a variable
Miles=float(print(‘William, please tell me how many miles you want converted to kilometers: ‘))
#Perform the conversion in arithmetic expression
#Store the result in a variable
Kilometers=Miles*1.6
Print(William,Miles,miles is equal to,Kilometers,kilometers. Isn’t that amazing!)
when I run this, this is what I get:
Python 3.7.4 (tags/v3.7.4:e09359112e, Jul 8 2019, 19:29:22) [MSC v.1916 32 bit (Intel)] on win32
Type help, copyright, credits or license() for more information.
RESTART: C:/Users/Gsuar/AppData/Local/Programs/Python/Python37-32/Gretchen_ Suarez_Lab2.py
William, please tell me how many miles you want converted to kilometers:
Traceback (most recent call last):
File C:/Users/Gsuar/AppData/Local/Programs/Python/Python37-32/Gretchen_ Suarez_Lab2.py, line 4, in module
Miles=float(print(‘William, please tell me how many miles you want converted to kilometers: ‘))
TypeError: float() argument must be a string or a number, not ‘NoneType’
Please, I need help to fix this.
Python Programming