1. Rewrite these 5 python statements using a list: myCoursel "ET710" myCourse2 "ET574" myCourse3 "ENG310" print (myCourse 3) print (myCoursel) Output Example ENG310 ET710 2. Modify the list from above so that it contains the names of your current courses. a) Print the list of courses. b) Use the len method to print "I am taking X courses" where X is the number of courses in the list. Hint: If using concatenation, an integer must be converted to a string using str() Output Example ['ET574', 'ET575', 'ET580', 'ET585', 'ET725'] I am taking 5 courses. 3. Modify (permanently) the above list so that it is in reverse alphabetical order. a) print the list Output Example 'ET585', 'ET580', 'ET575', 'ET574', 'ET725']

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

Please answer the ques in python and please show me the code please

1. Rewrite these 5 python statements using a list:
myCoursel = "ET710"
myCourse2 = "ET574"
myCourse3 = "ENG310"
print (myCourse3)
print (myCoursel)
Output Example
ENG310
ET710
2. Modify the list from above so that it contains the names of your current
courses.
a) Print the list of courses.
b) Use the len method to print "I am taking X courses" where X is the
number of courses in the list. Hint: If using concatenation, an integer
must be converted to a string using str()
Output Example
['ET574', 'ET575', 'ET580', 'ET585', 'ET725']
I am taking 5 courses.
3. Modify (permanently) the above list so that it is in reverse alphabetical
order.
a) print the list.
Output Example
'ET585', 'ET580', 'ET575', 'ET574', 'ET725']
4. Create an empty list called numbers.
a) Add 2 and 4 into the list.
b) Print the list.
c) Add 0, 1 and 3 in proper order.
d) Print the list.
e) Remove and print 2 from the list.
f) Print the list.
g) Add 5 to the list
h) Print the list
Output Example
[2, 4]
[0, 1, 2, 3, 4]
2
[0, 1, 3, 4]
[0, 1, 3, 4, 5]
Transcribed Image Text:1. Rewrite these 5 python statements using a list: myCoursel = "ET710" myCourse2 = "ET574" myCourse3 = "ENG310" print (myCourse3) print (myCoursel) Output Example ENG310 ET710 2. Modify the list from above so that it contains the names of your current courses. a) Print the list of courses. b) Use the len method to print "I am taking X courses" where X is the number of courses in the list. Hint: If using concatenation, an integer must be converted to a string using str() Output Example ['ET574', 'ET575', 'ET580', 'ET585', 'ET725'] I am taking 5 courses. 3. Modify (permanently) the above list so that it is in reverse alphabetical order. a) print the list. Output Example 'ET585', 'ET580', 'ET575', 'ET574', 'ET725'] 4. Create an empty list called numbers. a) Add 2 and 4 into the list. b) Print the list. c) Add 0, 1 and 3 in proper order. d) Print the list. e) Remove and print 2 from the list. f) Print the list. g) Add 5 to the list h) Print the list Output Example [2, 4] [0, 1, 2, 3, 4] 2 [0, 1, 3, 4] [0, 1, 3, 4, 5]
5. Create a list letters, that contains all lowercase letters from a to e.
a) Print the list.
b) Print the second to last element in the list.
c) Reverse the list.
d) Print the list.
e) Print the third to last element in the list.
f) Replace the lowercase letter 'b' with uppercase letter 'B'.
g) Replace the lowercase letter 'd' with uppercase letter 'D'.
h) Print the list.
i) Alphabetically sort the list.
j) Print the list.
What do you notice about how the list has been sorted?
Output Example
['a', 'b', 'c', 'd', 'e']
d
['e', 'd', 'c', 'b', 'a']
с
['e', 'D', 'c', 'B', 'a']
[ 'B', 'D', 'a', 'c', 'e', ]
Transcribed Image Text:5. Create a list letters, that contains all lowercase letters from a to e. a) Print the list. b) Print the second to last element in the list. c) Reverse the list. d) Print the list. e) Print the third to last element in the list. f) Replace the lowercase letter 'b' with uppercase letter 'B'. g) Replace the lowercase letter 'd' with uppercase letter 'D'. h) Print the list. i) Alphabetically sort the list. j) Print the list. What do you notice about how the list has been sorted? Output Example ['a', 'b', 'c', 'd', 'e'] d ['e', 'd', 'c', 'b', 'a'] с ['e', 'D', 'c', 'B', 'a'] [ 'B', 'D', 'a', 'c', 'e', ]
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 3 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY