Created
August 31, 2016 19:35
-
-
Save albertochiwas/f8d5124b5ef836d25c8af239326a6f83 to your computer and use it in GitHub Desktop.
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
Star = u"\u2605" | |
def getTuplas(msj, ini, fin): | |
salida = [] | |
for i in range(ini,fin+1): | |
tupla = (msj, i) | |
salida.append(tupla) | |
return salida | |
print "\nStarbucks score:" | |
tuplas = getTuplas("Stars",3,7) | |
print tuplas | |
for i in tuplas: | |
m, n = i | |
s = n * Star | |
print u"%s = %s" % (m, s) |
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
Star = u"\u2605" | |
def getTuplas( msj, ini, fin ): | |
salida = [] | |
for i in range(ini,fin+1): | |
tupla = (msj, i) | |
salida.append(tupla) | |
return salida | |
def getStrings( tuplas ): | |
salida = [] | |
for i in tuplas: | |
m, n = i | |
s = n * Star | |
salida.append(u"%s = %s" % (m, s)) | |
return salida | |
def printStars( stars ): | |
for star in stars: | |
print star | |
printStars(getStrings(getTuplas("Stars",3,7))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment