1.Create and empty list name
lstWeekDay. Set up a loop for the user
to enter each of the days of the week one at a time.(Sunday, Monday, Tuesday,
etc...............) and add the days to lstWeekDays as they are entered by the
use(requires use of append method)
2.Using a For loop, print the
lstWeekDays List each on their own line.
3.Reverse the order of the
lstWeekDayslist. Now print itusing a
loop.
4.Sort the lstWeekDays list
alphabetically. Now print it using a loop.
5.Print the full weekday and then
“=”and then the first three characters of the each of lstWeekDays(requires for loop
and slicing)
Sample output:
Sunday = Sun
Monday = Mon
6.Print only the days of the week in
lstWeekDaysList that begin with the letter “T”. (remember case sensitivity – this
requires a “for”loop and indexing)
7. Create a dictionary named
dctCourses. Place the following value
and key pairs in it: Value
Key |
value |
1000 |
Intro to IS |
1301 |
HTML &CSS |
1505 |
Fundamentals of Programming |
2575 |
.Net Programming 1 |
2585 |
.Net Programming 2 |
2701 |
Database Design & SQL |
8. Get a list of the values in
dctCourses and print the values in sorted order (see sample code).
9. Get a list of the keys in
dctCourses and print the values in sorted order (see sample code).
10. Print
the value that has a key of 1505(using the
dictionary get method)
Sun | Mon | Tue | Wed | Thu | Fri | Sat |
---|---|---|---|---|---|---|
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 | 1 | 2 |