Last active
October 28, 2019 06:58
-
-
Save klamfa/c4d7cd91f55a5bc97be41aebe05a63ad to your computer and use it in GitHub Desktop.
Homework 2
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
do_convert = "yes" | |
print("Welcome to the km to mi converter!") | |
while do_convert == "yes": | |
kilometers = int(input("How many kilometers do you want to convert to miles? ")) | |
miles = kilometers * 0.621371 | |
print (str(kilometers) + " km is " + str(miles) + " mi!") | |
do_convert = input("Would you like to make another conversion? Enter yes or no here: ") | |
if do_convert == "no": | |
print ("Thanks for using this converter!") |
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
count_limit = int(input("Please enter the number between 1 and 100 you want me to count to, here: ")) | |
answer = None | |
if count_limit > 100: | |
print("Number is too big!") | |
else: | |
for number in range (1, count_limit + 1): | |
if number % 3 == 0 and number % 5 == 0: | |
answer = "fizzbuzz" | |
elif number % 3 == 0: | |
answer = "fizz" | |
elif number % 5 == 0: | |
answer = "buzz" | |
else: | |
answer = number | |
print (answer) | |
print ("Now try saying THAT three times fast!") |
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
sentence = str.lower ("HoW vErY NiCE iS ThiS sEntEnCe!") | |
print (sentence) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Fixed it, thanks!