You are on page 1of 1

Exercises on Data Types, Operators & I-O

1. (a) Write statements to prompt a user to input their favourite food and favourite colour
and display this information in the format "My favourite food is xxxx and my favourite
colour is yyyy", using + symbols to concatenate the separate strings.
(b) Display the same information using the comma separator instead of + symbols.
2. (a) Write statements to ask the user to enter their name and telephone number and then
print this information on two separate lines, with a blank line in between.
(b) Print the name and telephone number on the same line. separated by a tab
character.

3. Write statements to:


(a) perform the integer division of 40 by 11
(b) find the remainder when 40 is divided by 11
(c) calculate 210
(d) test whether “three" is greater than “two"
(e) test whether "abc' is less than than "ABC"
(f) test whether (1 <=4 and 7<=7) is True
(g) find the result of the Boolean condition equivalent to: “Fred' not equal to “fred"

You might also like