Last active
December 13, 2019 12:03
-
-
Save Bundi-py/71adf782a5031b2728aed0877be8e21b to your computer and use it in GitHub Desktop.
Zadatak broj 3: Unesemo četiri artikla i program ih na kraju izlista. S tim što iza svakog ubaci zarez, a pre poslednjeg artikla stavi veznik "i", kao što je i red.
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
lista = [] | |
print('Unesi četiri artikla') | |
prvi = input('prvi: ') | |
drugi = input('drugi: ') | |
treci = input('treći: ') | |
cetvrti = input('cetvrti: ') | |
lista = [prvi, drugi, treci, cetvrti] | |
def zarez(artikal): | |
for x in range(len(artikal) -2): | |
print(artikal[x], end=", ") | |
print(artikal[-2] + ' i ' + artikal[-1]) | |
zarez(lista) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment