Python Programming: Chapter 1- Project 1

Опубликовано: 01 Апрель 2026
на канале: Learning Channel
4,158
like

(Population projection)
The US Census Bureau projects population based on the following assumptions:
One birth every 7 seconds
One death every 13 seconds
One new immigrant every 45 seconds
Write a program to display the population for each of the next five years. Assume the current population is 312032486 and one year has 365 days.

4. (Simple computation)
The formula for computing the discriminant of a quadratic equation ax^2 + bx + c = 0 is b^2 – 4ac.
Write a program that computes the discriminant for the equation 3x^2 + 4x + 5 = 0.

5. (Physics: acceleration)
Average acceleration is defined as the change of velocity divided by the time taken to make the change, as shown in the following formula:
a = (v1 - v0) / t
Here, v0 is the starting velocity in meters/second, v1 is the ending velocity in meters/second, and t is the time span in seconds.
Assume v0 is 5.6, v1 is 10.5, and t is 0.5, and write the code to display the average acceleration.

by Szymon Machajewski