"> ");
100%
LESSONS & TOPICS

Exercises Logical expressions and selection structure

Exercises Logical expressions and selection structure

 

Exercises

Exercise 1

Write a python program where the user’s name will be requested. If the name is: John show the message: Hey John! What’s up ?. If the name is Mary, show the message: Hey Mary! How are you today ?. For any other name the user may be able to see the message: Hello “name”

 

Exercise 2

Write a python program where the user enters 10 random numbers from the keyboard and the program counts how many of them are greater than 10.

 

Exercise 3

Write a Python program which iterates the integers from 1 to 50. For multiples of three print “threes” instead of the number and for the multiples of five print “fives”. For numbers which are multiples of both three and five print “threesfives”.

 

Exercise 4

Write a Python program to find the largest among three numbers.

 

 

Exercise 5

Write a Python program to find the median of three numbers.

 

Click the following link to get access to more exercises..