Last active
October 21, 2020 17:58
-
-
Save bugkiller78/15d66143016ccd66ac89721710bb3678 to your computer and use it in GitHub Desktop.
SmartNinja_DN2_1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#DN2.1 Unit converter | |
name = str.upper(input('Please enter your name :')) | |
print( 'Hello ' + str(name) + ' , with this program you can easily convert KM to Miles: ') | |
Miles_conversion = 1.61 #Pretvornik Km/Milje | |
while True: # Loop ki je omejen z ukazom break | |
KM = input('Please, convert desired KMs :') | |
miles = float(KM) * Miles_conversion | |
print( 'The entered ' + str(KM) + ' Kilometers are equal to ' + str(miles) + ' Miles' ) | |
repeat =str.lower( input('Would you like to make another conversion: ')) | |
if repeat == 'no': | |
print('Thank you for using the program, goodbye!') | |
break # break pomeni zaključek loopa | |
elif repeat == 'yes' : | |
print('') | |
else: | |
print('Wrong answer, the conversion is over! ') | |
break |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Super, imas pa napako v formuli.
V vrstici 5 je potrebno zamenjati 1.61 z 0.61 (pravo konverzijo).