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
import datetime | |
import json | |
import random | |
secret = random.randint(1,30) | |
attempts = 0 | |
current_time = datetime.datetime.now() | |
wrong_attempts = 0 | |
print('Current date and time ' + str(current_time)) |
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
import datetime | |
import json | |
import random | |
secret = random.randint(1,30) | |
attempts = 0 | |
current_time = datetime.datetime.now() | |
print(current_time) |
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.3 Make sting lowercase | |
answer = str.lower(input('Please answer with YES or NO to the following question: ')) | |
print(answer) |
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.2 FIZZBUZZ | |
print('Welcome to FIZZ AND BUZZ program') | |
number = int(input( 'Please enter your desired number between 1 and 100:')) | |
for x in range(1, number + 1): #določi število ponovitev loopa | |
if x % 3 == 0: # Če je številka deljiva z celim številom dobimo vrednost 0 , če ni pa vrednost 1 | |
print('FIZZ') |
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 |
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 3 | |
#Calculator | |
number_1 = input("Enter number 1 :") | |
number_2 = input("Enter number 2 :") | |
operator = input("Enter desired matehematical operation: ") | |
if operator == "-": | |
print(int(number_1) - int(number_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
#Domača naloga 2 | |
#Guess the number | |
secret_number = 33 | |
guess = input("Please, guess the number:") | |
if secret_number == int(guess): | |
print("Congratulations, you WON!!!") | |
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
#Domača naloga 1 | |
#Mood checker | |
print("Please answer to the following question") | |
mood = input("What is your mood today:") | |
if str.lower(mood) == "happy": | |
print("It is great to see you happy!") | |
elif str.lower(mood) == "nervous": |