I know I need a for loop, I am trying to print the input number(as a maximum) and then print the number of steps it took to reach 1. The current program prints the input number and the nember of steps for that input number, I need it to print every input number and corresponding steps for each number to 1 with related steps. If i input 2 it should say it 2 takes 1 steps then 1 takes 0 steps.
n = int(input('n? '))
n_steps = 0
num=n
while n > 1:
n_steps+=1
if n % 2 == 0:
n = n // 2
else:
n = n * 3 + 1
print(str(num) + ' takes ' + str(n_steps) + ' steps')
for _ in range(X):orwhile Trueto wrap all your codenum1=nabove then_steps=0and put everything belownum1=ninto for loop that counts down from num1 and at the end of the iteration decreasenum. that should do the trick