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
# Guess the secret number | |
import json | |
import datetime | |
import random | |
#secret = random.randint(1,30) | |
secret = 5 | |
attempts = 0 #vsi poizkusi | |
st_napacnih_odg = 0 #napačni odgovori |
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
# Domača naloga 2.3: Make string lowercase | |
besedilo = input('Uporabnik, vnesi besedilo, ' | |
'kjer uporabljaš velike in male črke:').lower() | |
print('Sedaj se bo izpisal text z malimi črkami: ', besedilo) |
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
# Domača naloga 2.2: FizzBuzz | |
x=1 | |
#fizz deljivo s 3 | |
#buzz deljivo s 5 | |
stevilo = int(input('Vnesi število med 1 in 100:')) | |
while x <= stevilo: | |
if x % 5 == 0 and x % 3 == 0: | |
print ('fizz_buzz') | |
elif x % 3 == 0: |
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
# Vaja 2.1: Unit converter | |
#uvod | |
print('Pozdravljen uporabnik! Ta program bo ' | |
'pretvoril kilometre v milje.') | |
#vnasanje števila v km | |
number_km = int(input("Vnesite željeno številko v kilometrih!")) | |
print ('Vrednost pretvorjena v milje:', | |
0.621 * number_km ) | |
#vprasaj uporabnika ce zeli nadaljevati | |
odgovor = "ja" |
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
# Domaca naloga 1.3 | |
# Calculator | |
number_a = int(input('Insert first Number')) | |
number_b = int(input('Insert second Number')) | |
operation = input('Insert operation') | |
if operation == "+": | |
print('addition a+b:', number_a + number_b) | |
elif operation == "-": |
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
# Domaca naloga 1.2 | |
# Guess the secret number | |
secret = 3 | |
guess = int(input('Guess the secret number! ;) The number is between 0 and 10.')) | |
if guess == secret: | |
print ('Congratulation! Well done!') | |
else: |
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
# Domaca naloga 1.1 | |
# The mood checker | |
mood = input('how do you feel?').lower() | |
if mood == 'happy': | |
print("It is great to see you happy! :)") | |
elif mood == 'nervous': | |
print('Take a deep breath 3 times.') | |
elif mood == 'sad': | |
print('I understand. I am here for you if you want to talk.') |