You are on page 1of 2

2.

29 LAB: Divide by x
Instructor note:
Note: this section of your textbook contains activities that you will complete for
points. To ensure your work is scored, please access this page from the
assignment link provided in Blackboard. If you did not access this page via
Blackboard, please do so now.
Write a program using integers user_num and x as input, and output
user_num divided by x three times.
Ex: If the input is:
2000
2
Then the output is:
1000 500 250

if __name__ == '__main__':
user_num = int(input())
x = int(input())
print(user_num // x, user_num // x // x, user_num // x // x // x)

Code 2
user_num = int(input())

x = int(input())

user_num = user_num//x

print(user_num,end=' ')

user_num = user_num//x

print(user_num,end=' ')

user_num = user_num//x

print(user_num,end='')
print()

You might also like