Lab Activity 5.1
Implement a program that starts by asking the user to enter a login id (i.e., a string). The program then checks whether the id entered by the user is in the list [“joe”, “sue”, “hani”, “sophie”] of valid users. Depending on the outcome, an appropriate message should be printed. Regardless of the outcome, your function should print “Done.” Before terminating. Here is an example of a successful login:
>>>
Login: joe
You are in!
Done.
And here is one of that is not:
>>>
Login: john
User unknown
Done.
Lab Activity 5.2
Implement a program that requests from the user a list of words (i.e., strings) and then prints on the screen, on per line all four-letter strings in the list.
>>>
Enter word list: [“stop”, “desktop”, “top”, “post”]
stop
post
Lab Activity 5.3
Write the for loop that will print these sequences of numbers, one per line, in the interactive shell.
(a) Integers from 0 to 9 (i.e., 0, 1, 2, 3, 4, 5, 6, 7, 8, 9)
(b) Integers from 0 to 1 (i.e., 0, 1)