10 Questions
If the ball is dropped from a height of 64 cm, what will be its height after the first bounce?
32 cm
When should the program stop printing the heights according to the given instructions?
When the height reaches 0.05 cm
What output format should be used for printing the heights?
Floating-point numbers
If the user inputs a value of 10 for n (number of times to bounce), how many heights will be printed in total?
10 heights
What is the purpose of the 'append' operation in Python lists?
To add an item to the end of the list
How is indexing done in Python lists?
By accessing elements and subsets using assigned index values
What does the 'extend' operation do in Python lists?
Grows the list with additional items
In Python lists, what does negative indexing allow you to do?
Access the last item without knowing the list size
What does the 'insert' operation do in Python lists?
Places an item at a specific location in the list
What is slicing used for in Python lists?
To access a range of items by specifying start and stop indices
Learn how to write a program that calculates the heights of a ball as it bounces up and down given the initial height and number of bounces. The program prints the heights after each bounce until it reaches a minimum threshold.
Make Your Own Quizzes and Flashcards
Convert your notes into interactive study material.
Get started for free