this is a simple intro to CS question but something isn't working right and i can't seem to find why:
num = int(input("enter a number:"))
print()
print("Number\t\tSquare\t\tCube")
print(" ",num,"\t\t",num**2,"\t\t",num**3)
num=num+1
print(" ",num,"\t\t",num**2,"\t\t",num**3)
num=num+1
print(" ",num,"\t\t",num**2,"\t\t",num**3)
num=num+1
print(" ",num,"\t\t",num**2,"\t\t",num**3)
num=num+1
print(" ",num,"\t\t",num**2,"\t\t",num**3)
this is meant to print the number, it's square and it's cube, for num and it's 4 consecutive numbers, always with 2 tabs between them:
enter a number:-8
Number Square Cube
-8 64 -512
-7 49 -343
-6 36 -216
-5 25 -125
-4 16 -64
but when the square is a single digit answer the answer looks weird:
enter a number:-6
Number Square Cube
-6 36 -216
-5 25 -125
-4 16 -64
-3 9 -27
-2 4 -8
it seems to ignore a tab in the printing process and print a space instead. anybody has a clue as to why?