In Class, we were assigned a challenge to attempt to make python figure out how to do the 5 times tables by itself and make it loop until it reached "12x5". After long amounts of waiting, thinking and working, I finally came up with a smart solution. To look On the internet. It was then until i found the code for n in range(1,13): print( "%d x 5 = %d" % (n, n*5). This code continues the loop from "5x1" till "5x12". The picture below Shows it in action. However while i was working i came up with the Code
number=1
While number<9:
Print(number)
This Code was the code i was using but had failed.
number=1
While number<9:
Print(number)
This Code was the code i was using but had failed.
No comments:
Post a Comment