Problem 1:
Write a Python code to implement the following
If the last character in a 5-character string s is ’y’, then
1. change the ‘y’ to ‘i’
2. add ‘es ’
3. assign the result to a variable plural.
Otherwise,
just add ‘s’ and assign the result to a variable plural
Problem 2:
Given a numerical test score between 0 and 100, print out the letter grade equivalent according to these rules:
A 90-100
B 80-89
C 70-79
U <70
Problem 3:
Write a program that display whether the value of x is in [L,R] or not
X is inside the interval [L,R] if it is no smaller than L and no bigger than R.
Hint: use input prompt function to read the values of x, L and R
Sun | Mon | Tue | Wed | Thu | Fri | Sat |
---|---|---|---|---|---|---|
27 | 28 | 29 | 30 | 1 | 2 | 3 |
4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 | 20 | 21 | 22 | 23 | 24 |
25 | 26 | 27 | 28 | 29 | 30 | 31 |