Last active
October 28, 2019 07:00
-
-
Save klamfa/3e4a48bcd05dd6a2e1159f94db3e28b7 to your computer and use it in GitHub Desktop.
MVisnikar Homework 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
mood = input("How are you feeling? I don't have that much emotional inteligence, so your options are: happy, sad, excited, relaxed and nervous! Enter one here! ") | |
if mood == "happy": | |
print("It is great to see you happy!") | |
elif mood == "sad": | |
print("Watch an episode of Friends, it'll help.") | |
elif mood == "excited": | |
print("I'm excited you're excited!.") | |
elif mood == "relaxed": | |
print("Chill with your friends!") | |
elif mood == "nervous": | |
print("Take 3 deep breaths!") | |
else: | |
print("I don't recognize this mood.") |
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
secret = 5 | |
guess = int(input("Guess the secret number (between 1 and 30): ")) | |
if guess == secret: | |
print("You've guessed it - congratulations! It's number 5.") | |
else: | |
print("Sorry, your guess is not correct... The secret number is not " + str(guess)) |
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
first_number = int(input('Enter your first number here: ')) | |
operator = input('What operation do you want to do? +, -, * or /? ') | |
second_number = int(input('Enter your second number here: ')) | |
result = None | |
if operator == "+": | |
result = (first_number + second_number) | |
elif operator == "-": | |
result = (first_number - second_number) | |
elif operator == "*": | |
result = (first_number * second_number) | |
elif operator == "/": | |
result = (first_number / second_number) | |
else: | |
result = "You didn't enter a valid operator" | |
print(result) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
No need for extra blank lines in homework1-3 (at lines 8, 11, 14 and 17).
Other than that everything looks very good! Good work!