Write a Python Program to simulate Bouncing Ball
This program is done using Pygame
What is Python?
Python is an interpreted high-level general-purpose programming language. Python’s design philosophy emphasizes code readability with its notable use of significant indentation. Its language constructs as well as its object-oriented approach aim to help programmers write clear, logical code for small and large-scale projects.
What is Pygame?
Pygame is a cross-platform set of Python modules designed for writing video games. It includes computer graphics and sound libraries designed to be used with the Python programming language.
How to install pygame?
🔹Go to Command Prompt
🔹Type “pip install pygame” and it will be automatically downloaded
Concepts Involved
While loop:
In while loop we can execute a set of statements as long as a condition is true.
For loop:
A for loop is used for iterating over a sequence (that is either a list, a tuple, a dictionary, a set, or a string).
This is less like the for keyword in other programming languages, and works more like an iterator method as found in other object-orientated programming languages.
With the for loop we can execute a set of statements, once for each item in a list, tuple, set etc.
SCRIPT
Output
To know more about Python Programming visit GUVI: