creating a list

 Python 3.9.1 (tags/v3.9.1:1e5d33e, Dec  7 2020, 17:08:21) [MSC v.1927 64 bit (AMD64)] on win32

Type "help", "copyright", "credits" or "license()" for more information.

>>> ##creating a list

>>> list1[]

SyntaxError: invalid syntax

>>> list1=[]

>>> list1

[]

>>> list=[]

>>> list

[]

>>> list=[1,2,3,4,5,6,]

>>> list

[1, 2, 3, 4, 5, 6]

>>> list2=[1,2,3,4,"apple", "orange"]

>>> list2

[1, 2, 3, 4, 'apple', 'orange']

>>> 

Comments

Popular posts from this blog

XAMPP, SQL BASIC COMMANDS

The Minion Game Hackerrank Solution

Arrays - DS | HackerRank Solutions