You are on page 1of 1

Practise Sheet

Implement a Python program that calculates the electricity bill for a household.
Ask the user to enter the number of units consumed in a month and calculate
the bill based on the following rates:
- For the first 100 units: $0.10 per unit
- For the next 200 units: $0.15 per unit
- For the remaining units: $0.20 per unit
- Add a fixed service charge of $10.00
- Print the total bill.

Create a Python program that calculates the sum of all numbers between 1 and
100 that are divisible by both 3 and 5. (For loop)

Create a Python program that asks the user for a password. If the password is
"secret," print "Access granted." Otherwise, print "Access denied." Use while
loop.

Write a Python program that prints a pattern of stars in the shape of a right-
angled triangle. Ask the user for the height of the triangle and print the pattern
accordingly. (both For loop and while loop)

Write a Python program that calculates the sum of all the even numbers
between 1 and a user-specified positive integer "n" using a while loop.

You are creating a decision-making flowchart for a simple game. In the game,
the player must guess a random number between 1 and 100. If the player's
guess is too low, they receive a "Too low" message. If the guess is too high,
they receive a "Too high" message. If the guess is correct, they win the game.
Create a flowchart outlining the game logic.

Imagine you are designing a decision-making flowchart for a temperature


control system in a smart thermostat. The thermostat should determine
whether to heat, cool, or maintain the current temperature based on user
settings and the current room temperature. Design a flowchart that represents
the decision-making process.

Write a Python program that checks if a number is positive, negative, or zero.


Take the number as input from the user and print the result.

Design a decision-making flowchart for a program that takes two numbers as


input from the user and asks the user to choose an operation to perform
(addition, subtraction, multiplication, or division). Based on the user's choice,
perform the selected operation and display the result.

You might also like