In: Computer Science
Q2) How thick does paper folding get? Take one sheet out of your newspaper, and fold it in half, then fold it in half again, and again, and again. Can you fold it 30 times? Pretending that you can (you probably can’t fold it more than 8 times), how thick would it be after 30 times? Assume the paper is 1/200 cm. thick. Write a program to solve this puzzle. Prompt for the number of folds and output the thickness in meters. Note : Run by pycharm
Thanks for the question. Below is the code you will be needing Let me know if you have any doubts or if you need anything to change. Thank You !! ================================================================ folds = int(input('Enter the number of folds: ')) paper_thickness = 1 / 200 thickness = paper_thickness for i in range(folds): # every time the thickness doubles the previous thickness thickness = thickness*2 print(i+1,'folds',thickness,'cm') # you can comment this line print('Thickness after {} folds is: {} meters'.format(folds, thickness/100))
==================================================================