English

Consider a list: list1 = [6, 7, 8, 9] What is the difference between the following operation on the list1: list1 * 2 - Computer Science (Python)

Advertisements
Advertisements

Question

Consider a list:

list1 = [6, 7, 8, 9]

What is the difference between the following operation on the list1:

list1 * 2
One Line Answer

Solution

The statement will print the elements of the list twice, i.e [6, 7, 8, 9, 6, 7, 8, 9]. However, the list1 will not be altered.

shaalaa.com
List Operations
  Is there an error in this question or solution?
Chapter 9: Lists - Exercise [Page 205]

APPEARS IN

NCERT Computer Science [English] Class 11
Chapter 9 Lists
Exercise | Q 6. a. | Page 205
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×