Consider the following program: s = input() if s < \'a\': print(\"foo\") elif s
ID: 3911590 • Letter: C
Question
Consider the following program:
s = input()
if s < 'a':
print("foo")
elif s > 'a':
print("bar")
Which of the following statements is correct?
(There could be more than one correct answer.)
For all strings s that start with a capital letter, the program prints "foo".
For all strings s that start with "B", the program prints "bar".
There are some strings, for which the program does not print anything.
For all strings s that start with "aaaa", the program prints "bar".
For all strings s that start with a lower case letter, the program prints "foo".
Explanation / Answer
Correct statement are:
1.For all strings s that start with a capital letter, the program prints "foo".
2.For all strings s that start with "aaaa", the program prints "bar".