Python Made Simple: Learn Python programming in easy steps with examples by Rydhm Beri

Python Made Simple: Learn Python programming in easy steps with examples by Rydhm Beri

Author:Rydhm Beri [Beri, Rydhm]
Language: eng
Format: epub
Publisher: BPB Publications
Published: 2019-08-15T00:00:00+00:00


The preceding set of statements creates a list with a single element 20, list b with 2 elements 30 and 40 and the third statement creates a list c from the two lists a and b. This statement creates a list a as it is the first element of list c and list b is the second element of list c and the next statement prints the result stored in list c. Here, list c is nesting of a list.

Inputting nesting of a list

To input the nesting of a list from the user at run time, we first need to create an inner list and after creating the inner list, it should be appended to the outer list. This can be shown by the following example of code:

n=int(input(“Enter the number of elements:”))



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.