Created
October 18, 2020 07:13
-
-
Save bugkiller78/71523a6ffe7321bcb8e902444502217d to your computer and use it in GitHub Desktop.
SmartNinja_DN2_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
#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') | |
elif x % 5 == 0: | |
print('BUZZ') | |
elif x % 3 == 0 and x % 5 == 0: | |
print('FIZZBUZZ') | |
else: | |
print(x) | |
print('') | |
print('GAME OVER') | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Manjka ti del ki omeji vnos stevila med 1 in 100.
Eno izmed moznih resitev implementacije ti posiljam spodaj:
V tej kodi mora uporabnik vnasati stevilo tako dolgo dokler ga ne vnese med 1 in 100, ko pa mu program izpise pravilno, se hkrati tudi zakljuci.