"> ");
100%

Exercises Logical expressions and selection structure

Lesson Progress

Exercises Logical expressions and selection structure

CONGRATULATIONS!

you are a

0 of 15 questions answered correctly (0)

Sorry, you lost

0 of 15 questions answered correctly (0)

Lifeline
Score:
  • $1,000,000
  • $500,000
  • $250,000
  • $125,000
  • $64,000
  • $32,000
  • $16,000
  • $8,000
  • $4,000
  • $2,000
  • $1,000
  • $500
  • $300
  • $200
  • $100

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..