Question: Read the inputs and create a list with 5 numbers and print it: 1 2 3 4 4 [ 1 , 2 , 3 ,

Read the inputs and create a list with 5 numbers and print it: 12344
[1,2,3,4,4]
Now, print only the first 3 elements of your list using slicing.
[1,2,3]
Now, print the last 2 elements of your list using negative indexing.
[4,4]
Read another input from the user and find the number of occurrences of that number on the previously created list. 4
The number 4 appears 2 time(s) in the list.
P.S.: Loops are not allowed for solving this question.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!