List creation variations
Lists can be created by direct declaration of values that go into it using square brackets. Constructor based creation can also be used.
Source Code
|
|
Run Output
Notes
- The constructor based creation takes any sequence (list, tuple or range) input and creates a list out of it. The same input can be given in a literal form or by way of taking the user input.
- The original iterable is not changed when
listis used to create a list from it.
Created: 9-Jul-2026 18:35 | Updated: 29-Sep-2026 15:32|
