Which of the following commands will create a List?
List1=list( )
List1=[ ]
List1=[ 1,2,3,4,'a' ]
All of these
Answers
Answer:
here is your answer
Explanation:
all of these
List1=list( )
List1=[ ]
List1=[ 1,2,3,4,'a' ]
are the following commands which can be used to create a List.
All of these is the correct option.
Extra Information
A list contains python objects and objects inside are separated by comma (,) and enclosed within square brackets.
List can contain values of the types Integers, Floats, Lists, and Tuples.
Integer Values such as the whole numbers can be positive, negative and zero. Example => 5, 6, 7, -8, 0 etc.
Float values are those values that consist of decimal numbers. Example => 5.25, 9.187 etc.
Python is created by Guido van Rossum and came into existence in 1991. It is a high-level and general programming language. It is a very lucid programming language as it has a good language construct and object-oriented approach. It is dynamically typed and garbage-collected.