You are on page 1of 2

Exercises:

(1)
 Learn about the module random
 Write a Python program to generate random value between two integers
(inclusive) and a random multiple of 7 between 0 and 70. Напишите
программу Python для генерации случайного значения между двумя
целыми числами (включительно) и случайным числом, кратным 7,
между 0 и 70.
 Use random.randint()
(2)
Write a Python program to get a string from a given string where all occurrences of
its first char have been changed to '$', except the first char itself.

 Sample String : 'restart'


 Expected Result : 'resta$t'

(3)
Write a Python program to get a single string from two given strings, separated by
a space and swap the first two characters of each string.
Sample String : 'abc', 'xyz' Expected Result : 'xyc abz'
(4)
Find a greater number between two numbers Input 2 numbers, output greater one
(5)
Write a program to calculate electricity bill Input: unit Output: price
First 100 units - no charge Next 100 units - 5 per unit After 200 units - 15 per unit
(6)
Write a program to calculate the grade:

 0-49 F
 50-54 D
 55-59 D+
 60-64 C-
 65-69 C
 70-74 C+
 75-79 B-
 80-84 B
 85-89 B+
 90-94 A-
 95-100 A

You might also like