#QUIZ02

Type in an integer and then raise it to the power of another integer. r its like a joker variable only used to save the value o “a” in order to keep going inside the while loop, until the “b” its equal to one.

2016-02-19 (2)

The second program of the quiz, print the number the user type in, and returns the number of stars corresponding to the number the user wrotes. The trick its not doing the string “*” times de number, you need to find another way.

I used a while loop in order to append one by one star into the list, then another while loop to print the list, when an end=”” it means that it will print a space and not a new line.

2016-02-19 (3)

code:

https://www.dropbox.com/s/dx8zx7uiunz3wu2/quiz2-2.py?dl=0

https://www.dropbox.com/s/x9htbn5ss1lb153/quiz2-1.py?dl=0

 

#TC101

Quiz #2 :s

En este quiz tuve que realizar dos códigos con funciones, el primero consistía en crear una función y llamarla “superpower” la cual me serviría para ingresar dos números, los cuales el primero seria la base y el segundo seria el numero de exponente, es decir, con base en este numero (n) el primer numero se multiplicaría n veces, esto lo lleve a cabo mediante un loop dentro de la misma función para que el primer numero se multiplicara por si mismo hasta que el contador fuera igual al numero del exponente. 

Quiz_2_prog1

En el segundo código tuve que crear otra función llamada “stars” la cual consistía en preguntarle al usuario en el numero de estrellas que quería que aparecieran, con base en esto cree un loop dentro de la misma función para que el contador se vaya incrementando hasta llegar al numero el cual fue tecleado por el usuario y así mismo vaya imprimiendo las estrellas hasta llegar a la cantidad pedida. 

Quiz_2_prog2

Los códigos que realice se encuentran en la siguiente liga de Dropbox:

https://www.dropbox.com/sh/au7l2qcp32kp04e/AABFkfgYB0vf32jAJ_Q1hM8oa?dl=0