Second Quiz

Another class, another quiz.

This time we were in charge of making loops. However, since I found out a the easy way, I used those methods.

For the first part we were in charge of ‘a’ be at ‘b’ power. In Python 3 this operatios is represented with “**”. So the code looks somehow like this:

quizpower.png

Then the second question requested us to print “*” a certain number of times in the same line. Even so it was forbidden, I used multipications to print x number of times the symbol “*”. Yet, I could not find out a way to print it at the same line. Still in the process of exploring other people’s blogs to see the other way to do this two exercises and to find out how to print in the same line.

Here code for part 2:

printstars.png

And this is how it runs!

printstars.png