This is the code that I am running:
for x in range(0,90):
print (x*(5/90))
for some reason, all it prints out are 0's. What am I doing wrong?
Thanks
What's happening is that it is figuring that you really want Integers. Try change it to be:
print(x*(5.0/90))
in python dividing an int by another int give an int so to get the float result you can simply add a ".0" behind any integer to avoid casting.
change it by
for x in range(0,90): print (x*(5/90.0))
This should work:
for x in range(0,90): print (x*(5/90.0))
Python is interpreting the numbers as integers and therefore the result is 0