Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Exercise 1 : Suppose we have the following list: x = [ 5 , 1 0 , 3 , 2 , 8 , 0 ]

Exercise 1: Suppose we have the following list:
x=[5,10,3,2,8,0]
a) what is x[:2:-1]?
b) explain what would be the "start" when it is not specified in slicing and the stride is negative. Why does it make sense?
Exercise 2: Suppose we have the following list:
a=[1,2,3,4]
Which of the following creates a list with elements being the corresponding elements of "a" added to 1?
A)a+1
B)a+[1,1,1,1]
C) for i in a
D)a+1
Exercise 3: Suppose we have the following dictionary:
a) Write a piece of code that loops through the values of this dictionary and makes the first letter in each word upper case (hint: check out string.title() method). The output should look like this:
value = Good
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Professional SQL Server 2012 Internals And Troubleshooting

Authors: Christian Bolton, Justin Langford

1st Edition

1118177657, 9781118177655

More Books

Students also viewed these Databases questions

Question

4. Develop a self-directed learning module.

Answered: 1 week ago

Question

2. Provide recommendations for effective on-the-job training.

Answered: 1 week ago