尊敬的 微信汇率:1円 ≈ 0.046166 元 支付宝汇率:1円 ≈ 0.046257元 [退出登录]
SlideShare a Scribd company logo
[DECLARATION AND INTIALIZATION OF LIST]
COMPUTER SCIENCE(083)
CLASS: XII
LIST IN PYTHON
PART-1
What is List?
How we declare a List?
How we initialize a List?
Different methods of initializing list.
WHAT IS LIST:
A list is a collection of values or an ordered sequence of values.
Values in the list can be
Elements of a list enclosed in a square brackets [ ], separated by
commas (,) .
Syntax:
list_name= [value1, value2,……..,valueN]
Example:
No_list = [ 10, 20, 30, 40, 50 ]
HOW TO CREATE AND INITIALIZE LIST
Method 1: If list is declare empty.
list1=[ ]
Method 2: Initialize list with value:
If we want to store the numbers in a list.
list2= [10, 20, 30, 40, 50]
If we want to store the words or string in a list.
list3= [“Mango”, “Apple”,”Grapes”,”Oranges”]
HOW TO CREATE AND INITIALIZE LIST
If we want to store the characters in a list.
list4= [‘A’,’E’,’I’,’O’,’U’]
If we want to store the mixed information in a list.
list4= [“Kapil”, 13,”Class-IX”, 40]
TO DISPLAY THE LIST
Example:
list2= [10, 20, 30, 40, 50]
print(list2)
----------------Output-------------
[10, 20, 30, 40, 50]
Example:
list3= [“Mango”, “Apple”,”Grapes”,”Oranges”]
print(list3)
----------------Output-------------
[‘Mango’, ‘Apple’, ’Grapes’, ’Oranges’]
HOW TO CREATE AND INITIALIZE THE
LIST USING LIST() CONSTRUCTOR
Syntax:
list_name=list(sequence or string)
Example:
list1=list(‘Computer’)
print(list1)
----------output----------
[‘C’,’o’,’m’,’p’,’u’,’t’,’e’,’r’]
If we want to store the characters in a list.
list4= list((‘A’,’E’,’I’,’O’,’U’))
---------Output----------
[‘A’, ‘E’,’I’,’O’,’U’]
HOW TO CREATE AND INITIALIZE THE
LIST USING LIST() CONSTRUCTOR
Example:
If we want to store the mixed information in a list.
list4= list((“Kapil”, 13,”Class-IX”, 40))
----------------Output-------------
[‘Kapil’, 13,’Class-IX’, 40]
Example: If we want to store the numbers in a list.
List_=list((10, 20, 30, 40, 50))
----------------Output-------------
[10, 20, 30, 40, 50]
HOW USER ENTER THE VALUES IN A LIST
AT RUN TIME
Using input() function how we can enter the number inside the list.
If we want to enter number 1,2,3,4,5,6,7,8,9 using keyboard at the
run time
Example:
no=list(input(“Enter the no”))
print(no)
-----------Output-------------
[‘1’,’2’,’3’,’4’,’5’,’6’,’7’,’8’,’9’]
These numbers are store in a character format as these numbers
are display in ‘1’ format.
We can use eval( ) method, which identifies the data type and
evaluate them automatically.
Example:
no=eval(input(“Enter the no:”))
print(no)
-------Input-----------
Enter the no: [1,2,3,4,5,6,7,8,9]
-----------Output-------------
[1,2,3,4,5,6,7,8,9]
-------Input-----------
Enter the no: 1,2,3,4,5,6,7,8,9
-----------Output-------------
(1,2,3,4,5,6,7,8,9)
If you enter the number with square
brackets it will create List
If you enter the number without
square brackets it will create tuple

More Related Content

What's hot

Python list
Python listPython list
Python list
Mohammed Sikander
 
Bca data structures linked list mrs.sowmya jyothi
Bca data structures linked list mrs.sowmya jyothiBca data structures linked list mrs.sowmya jyothi
Bca data structures linked list mrs.sowmya jyothi
Sowmya Jyothi
 
Quick sort algorithn
Quick sort algorithnQuick sort algorithn
Quick sort algorithn
Kumar
 
Chapter 15 Lists
Chapter 15 ListsChapter 15 Lists
Chapter 15 Lists
Praveen M Jigajinni
 
Stack and Queue
Stack and Queue Stack and Queue
Stack and Queue
Apurbo Datta
 
Ppt on Linked list,stack,queue
Ppt on Linked list,stack,queuePpt on Linked list,stack,queue
Ppt on Linked list,stack,queue
Srajan Shukla
 
Data Structure (Queue)
Data Structure (Queue)Data Structure (Queue)
Data Structure (Queue)
Adam Mukharil Bachtiar
 
Priority Queue in Data Structure
Priority Queue in Data StructurePriority Queue in Data Structure
Priority Queue in Data Structure
Meghaj Mallick
 
List,tuple,dictionary
List,tuple,dictionaryList,tuple,dictionary
List,tuple,dictionary
nitamhaske
 
Singly link list
Singly link listSingly link list
Singly link list
Rojin Khadka
 
Python programming : Arrays
Python programming : ArraysPython programming : Arrays
Python programming : Arrays
Emertxe Information Technologies Pvt Ltd
 
Linked list
Linked listLinked list
Linked list
KalaivaniKS1
 
PPT On Sorting And Searching Concepts In Data Structure | In Programming Lang...
PPT On Sorting And Searching Concepts In Data Structure | In Programming Lang...PPT On Sorting And Searching Concepts In Data Structure | In Programming Lang...
PPT On Sorting And Searching Concepts In Data Structure | In Programming Lang...
Umesh Kumar
 
Data structure power point presentation
Data structure power point presentation Data structure power point presentation
Data structure power point presentation
Anil Kumar Prajapati
 
Data structure array
Data structure  arrayData structure  array
Data structure array
MajidHamidAli
 
Data Structures - Searching & sorting
Data Structures - Searching & sortingData Structures - Searching & sorting
Data Structures - Searching & sorting
Kaushal Shah
 
Python Programming Essentials - M12 - Lists
Python Programming Essentials - M12 - ListsPython Programming Essentials - M12 - Lists
Python Programming Essentials - M12 - Lists
P3 InfoTech Solutions Pvt. Ltd.
 
NESTED SUBQUERY.pptx
NESTED SUBQUERY.pptxNESTED SUBQUERY.pptx
NESTED SUBQUERY.pptx
Anusha sivakumar
 
DATA STRUCTURE AND ALGORITHMS
DATA STRUCTURE AND ALGORITHMS DATA STRUCTURE AND ALGORITHMS
DATA STRUCTURE AND ALGORITHMS
Adams Sidibe
 
C++ Arrays
C++ ArraysC++ Arrays
C++ Arrays
أحمد محمد
 

What's hot (20)

Python list
Python listPython list
Python list
 
Bca data structures linked list mrs.sowmya jyothi
Bca data structures linked list mrs.sowmya jyothiBca data structures linked list mrs.sowmya jyothi
Bca data structures linked list mrs.sowmya jyothi
 
Quick sort algorithn
Quick sort algorithnQuick sort algorithn
Quick sort algorithn
 
Chapter 15 Lists
Chapter 15 ListsChapter 15 Lists
Chapter 15 Lists
 
Stack and Queue
Stack and Queue Stack and Queue
Stack and Queue
 
Ppt on Linked list,stack,queue
Ppt on Linked list,stack,queuePpt on Linked list,stack,queue
Ppt on Linked list,stack,queue
 
Data Structure (Queue)
Data Structure (Queue)Data Structure (Queue)
Data Structure (Queue)
 
Priority Queue in Data Structure
Priority Queue in Data StructurePriority Queue in Data Structure
Priority Queue in Data Structure
 
List,tuple,dictionary
List,tuple,dictionaryList,tuple,dictionary
List,tuple,dictionary
 
Singly link list
Singly link listSingly link list
Singly link list
 
Python programming : Arrays
Python programming : ArraysPython programming : Arrays
Python programming : Arrays
 
Linked list
Linked listLinked list
Linked list
 
PPT On Sorting And Searching Concepts In Data Structure | In Programming Lang...
PPT On Sorting And Searching Concepts In Data Structure | In Programming Lang...PPT On Sorting And Searching Concepts In Data Structure | In Programming Lang...
PPT On Sorting And Searching Concepts In Data Structure | In Programming Lang...
 
Data structure power point presentation
Data structure power point presentation Data structure power point presentation
Data structure power point presentation
 
Data structure array
Data structure  arrayData structure  array
Data structure array
 
Data Structures - Searching & sorting
Data Structures - Searching & sortingData Structures - Searching & sorting
Data Structures - Searching & sorting
 
Python Programming Essentials - M12 - Lists
Python Programming Essentials - M12 - ListsPython Programming Essentials - M12 - Lists
Python Programming Essentials - M12 - Lists
 
NESTED SUBQUERY.pptx
NESTED SUBQUERY.pptxNESTED SUBQUERY.pptx
NESTED SUBQUERY.pptx
 
DATA STRUCTURE AND ALGORITHMS
DATA STRUCTURE AND ALGORITHMS DATA STRUCTURE AND ALGORITHMS
DATA STRUCTURE AND ALGORITHMS
 
C++ Arrays
C++ ArraysC++ Arrays
C++ Arrays
 

Similar to LIST IN PYTHON

Unit - 4.ppt
Unit - 4.pptUnit - 4.ppt
List in Python
List in PythonList in Python
List in Python
Sharath Ankrajegowda
 
List Data Structure.docx
List Data Structure.docxList Data Structure.docx
List Data Structure.docx
manohar25689
 
Unit 4 python -list methods
Unit 4   python -list methodsUnit 4   python -list methods
Unit 4 python -list methods
narmadhakin
 
Python List.ppt
Python List.pptPython List.ppt
Python List.ppt
T PRIYA
 
The Ring programming language version 1.9 book - Part 29 of 210
The Ring programming language version 1.9 book - Part 29 of 210The Ring programming language version 1.9 book - Part 29 of 210
The Ring programming language version 1.9 book - Part 29 of 210
Mahmoud Samir Fayed
 
Array in c
Array in cArray in c
Array in c
Ravi Gelani
 
Lecture2.pptx
Lecture2.pptxLecture2.pptx
Lecture2.pptx
Sakith1
 
List_tuple_dictionary.pptx
List_tuple_dictionary.pptxList_tuple_dictionary.pptx
List_tuple_dictionary.pptx
ChandanVatsa2
 
Pytho lists
Pytho listsPytho lists
The Ring programming language version 1.8 book - Part 27 of 202
The Ring programming language version 1.8 book - Part 27 of 202The Ring programming language version 1.8 book - Part 27 of 202
The Ring programming language version 1.8 book - Part 27 of 202
Mahmoud Samir Fayed
 
6. list
6. list6. list
Python List
Python ListPython List
Python List
Soba Arjun
 
python_avw - Unit-03.pdf
python_avw - Unit-03.pdfpython_avw - Unit-03.pdf
python_avw - Unit-03.pdf
AshaWankar1
 
Module-2.pptx
Module-2.pptxModule-2.pptx
Module-2.pptx
GaganRaj28
 
Python-List.pptx
Python-List.pptxPython-List.pptx
Python-List.pptx
AnitaDevi158873
 
Python lists
Python listsPython lists
Python lists
nuripatidar
 
Python list
Python listPython list
LIST_tuple.pptx
LIST_tuple.pptxLIST_tuple.pptx
LIST_tuple.pptx
Abhishek Tiwari
 
lec 2- array declaration and initialization.pptx
lec 2- array declaration and initialization.pptxlec 2- array declaration and initialization.pptx
lec 2- array declaration and initialization.pptx
shiks1234
 

Similar to LIST IN PYTHON (20)

Unit - 4.ppt
Unit - 4.pptUnit - 4.ppt
Unit - 4.ppt
 
List in Python
List in PythonList in Python
List in Python
 
List Data Structure.docx
List Data Structure.docxList Data Structure.docx
List Data Structure.docx
 
Unit 4 python -list methods
Unit 4   python -list methodsUnit 4   python -list methods
Unit 4 python -list methods
 
Python List.ppt
Python List.pptPython List.ppt
Python List.ppt
 
The Ring programming language version 1.9 book - Part 29 of 210
The Ring programming language version 1.9 book - Part 29 of 210The Ring programming language version 1.9 book - Part 29 of 210
The Ring programming language version 1.9 book - Part 29 of 210
 
Array in c
Array in cArray in c
Array in c
 
Lecture2.pptx
Lecture2.pptxLecture2.pptx
Lecture2.pptx
 
List_tuple_dictionary.pptx
List_tuple_dictionary.pptxList_tuple_dictionary.pptx
List_tuple_dictionary.pptx
 
Pytho lists
Pytho listsPytho lists
Pytho lists
 
The Ring programming language version 1.8 book - Part 27 of 202
The Ring programming language version 1.8 book - Part 27 of 202The Ring programming language version 1.8 book - Part 27 of 202
The Ring programming language version 1.8 book - Part 27 of 202
 
6. list
6. list6. list
6. list
 
Python List
Python ListPython List
Python List
 
python_avw - Unit-03.pdf
python_avw - Unit-03.pdfpython_avw - Unit-03.pdf
python_avw - Unit-03.pdf
 
Module-2.pptx
Module-2.pptxModule-2.pptx
Module-2.pptx
 
Python-List.pptx
Python-List.pptxPython-List.pptx
Python-List.pptx
 
Python lists
Python listsPython lists
Python lists
 
Python list
Python listPython list
Python list
 
LIST_tuple.pptx
LIST_tuple.pptxLIST_tuple.pptx
LIST_tuple.pptx
 
lec 2- array declaration and initialization.pptx
lec 2- array declaration and initialization.pptxlec 2- array declaration and initialization.pptx
lec 2- array declaration and initialization.pptx
 

More from vikram mahendra

Communication skill
Communication skillCommunication skill
Communication skill
vikram mahendra
 
Python Project On Cosmetic Shop system
Python Project On Cosmetic Shop systemPython Project On Cosmetic Shop system
Python Project On Cosmetic Shop system
vikram mahendra
 
Python Project on Computer Shop
Python Project on Computer ShopPython Project on Computer Shop
Python Project on Computer Shop
vikram mahendra
 
PYTHON PROJECT ON CARSHOP SYSTEM
PYTHON PROJECT ON CARSHOP SYSTEMPYTHON PROJECT ON CARSHOP SYSTEM
PYTHON PROJECT ON CARSHOP SYSTEM
vikram mahendra
 
BOOK SHOP SYSTEM Project in Python
BOOK SHOP SYSTEM Project in PythonBOOK SHOP SYSTEM Project in Python
BOOK SHOP SYSTEM Project in Python
vikram mahendra
 
FLOW OF CONTROL-NESTED IFS IN PYTHON
FLOW OF CONTROL-NESTED IFS IN PYTHONFLOW OF CONTROL-NESTED IFS IN PYTHON
FLOW OF CONTROL-NESTED IFS IN PYTHON
vikram mahendra
 
FLOWOFCONTROL-IF..ELSE PYTHON
FLOWOFCONTROL-IF..ELSE PYTHONFLOWOFCONTROL-IF..ELSE PYTHON
FLOWOFCONTROL-IF..ELSE PYTHON
vikram mahendra
 
FLOW OF CONTROL-INTRO PYTHON
FLOW OF CONTROL-INTRO PYTHONFLOW OF CONTROL-INTRO PYTHON
FLOW OF CONTROL-INTRO PYTHON
vikram mahendra
 
OPERATOR IN PYTHON-PART1
OPERATOR IN PYTHON-PART1OPERATOR IN PYTHON-PART1
OPERATOR IN PYTHON-PART1
vikram mahendra
 
OPERATOR IN PYTHON-PART2
OPERATOR IN PYTHON-PART2OPERATOR IN PYTHON-PART2
OPERATOR IN PYTHON-PART2
vikram mahendra
 
USE OF PRINT IN PYTHON PART 2
USE OF PRINT IN PYTHON PART 2USE OF PRINT IN PYTHON PART 2
USE OF PRINT IN PYTHON PART 2
vikram mahendra
 
DATA TYPE IN PYTHON
DATA TYPE IN PYTHONDATA TYPE IN PYTHON
DATA TYPE IN PYTHON
vikram mahendra
 
USER DEFINE FUNCTIONS IN PYTHON[WITH PARAMETERS]
USER DEFINE FUNCTIONS IN PYTHON[WITH PARAMETERS]USER DEFINE FUNCTIONS IN PYTHON[WITH PARAMETERS]
USER DEFINE FUNCTIONS IN PYTHON[WITH PARAMETERS]
vikram mahendra
 
USER DEFINE FUNCTIONS IN PYTHON
USER DEFINE FUNCTIONS IN PYTHONUSER DEFINE FUNCTIONS IN PYTHON
USER DEFINE FUNCTIONS IN PYTHON
vikram mahendra
 
FUNCTIONS IN PYTHON[RANDOM FUNCTION]
FUNCTIONS IN PYTHON[RANDOM FUNCTION]FUNCTIONS IN PYTHON[RANDOM FUNCTION]
FUNCTIONS IN PYTHON[RANDOM FUNCTION]
vikram mahendra
 
INTRODUCTION TO FUNCTIONS IN PYTHON
INTRODUCTION TO FUNCTIONS IN PYTHONINTRODUCTION TO FUNCTIONS IN PYTHON
INTRODUCTION TO FUNCTIONS IN PYTHON
vikram mahendra
 
Python Introduction
Python IntroductionPython Introduction
Python Introduction
vikram mahendra
 
GREEN SKILL[PART-2]
GREEN SKILL[PART-2]GREEN SKILL[PART-2]
GREEN SKILL[PART-2]
vikram mahendra
 
GREEN SKILLS[PART-1]
GREEN SKILLS[PART-1]GREEN SKILLS[PART-1]
GREEN SKILLS[PART-1]
vikram mahendra
 
Dictionary in python
Dictionary in pythonDictionary in python
Dictionary in python
vikram mahendra
 

More from vikram mahendra (20)

Communication skill
Communication skillCommunication skill
Communication skill
 
Python Project On Cosmetic Shop system
Python Project On Cosmetic Shop systemPython Project On Cosmetic Shop system
Python Project On Cosmetic Shop system
 
Python Project on Computer Shop
Python Project on Computer ShopPython Project on Computer Shop
Python Project on Computer Shop
 
PYTHON PROJECT ON CARSHOP SYSTEM
PYTHON PROJECT ON CARSHOP SYSTEMPYTHON PROJECT ON CARSHOP SYSTEM
PYTHON PROJECT ON CARSHOP SYSTEM
 
BOOK SHOP SYSTEM Project in Python
BOOK SHOP SYSTEM Project in PythonBOOK SHOP SYSTEM Project in Python
BOOK SHOP SYSTEM Project in Python
 
FLOW OF CONTROL-NESTED IFS IN PYTHON
FLOW OF CONTROL-NESTED IFS IN PYTHONFLOW OF CONTROL-NESTED IFS IN PYTHON
FLOW OF CONTROL-NESTED IFS IN PYTHON
 
FLOWOFCONTROL-IF..ELSE PYTHON
FLOWOFCONTROL-IF..ELSE PYTHONFLOWOFCONTROL-IF..ELSE PYTHON
FLOWOFCONTROL-IF..ELSE PYTHON
 
FLOW OF CONTROL-INTRO PYTHON
FLOW OF CONTROL-INTRO PYTHONFLOW OF CONTROL-INTRO PYTHON
FLOW OF CONTROL-INTRO PYTHON
 
OPERATOR IN PYTHON-PART1
OPERATOR IN PYTHON-PART1OPERATOR IN PYTHON-PART1
OPERATOR IN PYTHON-PART1
 
OPERATOR IN PYTHON-PART2
OPERATOR IN PYTHON-PART2OPERATOR IN PYTHON-PART2
OPERATOR IN PYTHON-PART2
 
USE OF PRINT IN PYTHON PART 2
USE OF PRINT IN PYTHON PART 2USE OF PRINT IN PYTHON PART 2
USE OF PRINT IN PYTHON PART 2
 
DATA TYPE IN PYTHON
DATA TYPE IN PYTHONDATA TYPE IN PYTHON
DATA TYPE IN PYTHON
 
USER DEFINE FUNCTIONS IN PYTHON[WITH PARAMETERS]
USER DEFINE FUNCTIONS IN PYTHON[WITH PARAMETERS]USER DEFINE FUNCTIONS IN PYTHON[WITH PARAMETERS]
USER DEFINE FUNCTIONS IN PYTHON[WITH PARAMETERS]
 
USER DEFINE FUNCTIONS IN PYTHON
USER DEFINE FUNCTIONS IN PYTHONUSER DEFINE FUNCTIONS IN PYTHON
USER DEFINE FUNCTIONS IN PYTHON
 
FUNCTIONS IN PYTHON[RANDOM FUNCTION]
FUNCTIONS IN PYTHON[RANDOM FUNCTION]FUNCTIONS IN PYTHON[RANDOM FUNCTION]
FUNCTIONS IN PYTHON[RANDOM FUNCTION]
 
INTRODUCTION TO FUNCTIONS IN PYTHON
INTRODUCTION TO FUNCTIONS IN PYTHONINTRODUCTION TO FUNCTIONS IN PYTHON
INTRODUCTION TO FUNCTIONS IN PYTHON
 
Python Introduction
Python IntroductionPython Introduction
Python Introduction
 
GREEN SKILL[PART-2]
GREEN SKILL[PART-2]GREEN SKILL[PART-2]
GREEN SKILL[PART-2]
 
GREEN SKILLS[PART-1]
GREEN SKILLS[PART-1]GREEN SKILLS[PART-1]
GREEN SKILLS[PART-1]
 
Dictionary in python
Dictionary in pythonDictionary in python
Dictionary in python
 

Recently uploaded

Diversity Quiz Finals by Quiz Club, IIT Kanpur
Diversity Quiz Finals by Quiz Club, IIT KanpurDiversity Quiz Finals by Quiz Club, IIT Kanpur
Diversity Quiz Finals by Quiz Club, IIT Kanpur
Quiz Club IIT Kanpur
 
IoT (Internet of Things) introduction Notes.pdf
IoT (Internet of Things) introduction Notes.pdfIoT (Internet of Things) introduction Notes.pdf
IoT (Internet of Things) introduction Notes.pdf
roshanranjit222
 
Diversity Quiz Prelims by Quiz Club, IIT Kanpur
Diversity Quiz Prelims by Quiz Club, IIT KanpurDiversity Quiz Prelims by Quiz Club, IIT Kanpur
Diversity Quiz Prelims by Quiz Club, IIT Kanpur
Quiz Club IIT Kanpur
 
INTRODUCTION TO HOSPITALS & AND ITS ORGANIZATION
INTRODUCTION TO HOSPITALS & AND ITS ORGANIZATION INTRODUCTION TO HOSPITALS & AND ITS ORGANIZATION
INTRODUCTION TO HOSPITALS & AND ITS ORGANIZATION
ShwetaGawande8
 
Observational Learning
Observational Learning Observational Learning
Observational Learning
sanamushtaq922
 
Erasmus + DISSEMINATION ACTIVITIES Croatia
Erasmus + DISSEMINATION ACTIVITIES CroatiaErasmus + DISSEMINATION ACTIVITIES Croatia
Erasmus + DISSEMINATION ACTIVITIES Croatia
whatchangedhowreflec
 
78 Microsoft-Publisher - Sirin Sultana Bora.pptx
78 Microsoft-Publisher - Sirin Sultana Bora.pptx78 Microsoft-Publisher - Sirin Sultana Bora.pptx
78 Microsoft-Publisher - Sirin Sultana Bora.pptx
Kalna College
 
Contiguity Of Various Message Forms - Rupam Chandra.pptx
Contiguity Of Various Message Forms - Rupam Chandra.pptxContiguity Of Various Message Forms - Rupam Chandra.pptx
Contiguity Of Various Message Forms - Rupam Chandra.pptx
Kalna College
 
Opportunity scholarships and the schools that receive them
Opportunity scholarships and the schools that receive themOpportunity scholarships and the schools that receive them
Opportunity scholarships and the schools that receive them
EducationNC
 
nutrition in plants chapter 1 class 7...
nutrition in plants chapter 1 class 7...nutrition in plants chapter 1 class 7...
nutrition in plants chapter 1 class 7...
chaudharyreet2244
 
220711130097 Tulip Samanta Concept of Information and Communication Technology
220711130097 Tulip Samanta Concept of Information and Communication Technology220711130097 Tulip Samanta Concept of Information and Communication Technology
220711130097 Tulip Samanta Concept of Information and Communication Technology
Kalna College
 
The basics of sentences session 8pptx.pptx
The basics of sentences session 8pptx.pptxThe basics of sentences session 8pptx.pptx
The basics of sentences session 8pptx.pptx
heathfieldcps1
 
Creation or Update of a Mandatory Field is Not Set in Odoo 17
Creation or Update of a Mandatory Field is Not Set in Odoo 17Creation or Update of a Mandatory Field is Not Set in Odoo 17
Creation or Update of a Mandatory Field is Not Set in Odoo 17
Celine George
 
Non-Verbal Communication for Tech Professionals
Non-Verbal Communication for Tech ProfessionalsNon-Verbal Communication for Tech Professionals
Non-Verbal Communication for Tech Professionals
MattVassar1
 
How to Create User Notification in Odoo 17
How to Create User Notification in Odoo 17How to Create User Notification in Odoo 17
How to Create User Notification in Odoo 17
Celine George
 
The Science of Learning: implications for modern teaching
The Science of Learning: implications for modern teachingThe Science of Learning: implications for modern teaching
The Science of Learning: implications for modern teaching
Derek Wenmoth
 
Talking Tech through Compelling Visual Aids
Talking Tech through Compelling Visual AidsTalking Tech through Compelling Visual Aids
Talking Tech through Compelling Visual Aids
MattVassar1
 
Library news letter Kitengesa Uganda June 2024
Library news letter Kitengesa Uganda June 2024Library news letter Kitengesa Uganda June 2024
Library news letter Kitengesa Uganda June 2024
Friends of African Village Libraries
 
CapTechTalks Webinar Slides June 2024 Donovan Wright.pptx
CapTechTalks Webinar Slides June 2024 Donovan Wright.pptxCapTechTalks Webinar Slides June 2024 Donovan Wright.pptx
CapTechTalks Webinar Slides June 2024 Donovan Wright.pptx
CapitolTechU
 
Post init hook in the odoo 17 ERP Module
Post init hook in the  odoo 17 ERP ModulePost init hook in the  odoo 17 ERP Module
Post init hook in the odoo 17 ERP Module
Celine George
 

Recently uploaded (20)

Diversity Quiz Finals by Quiz Club, IIT Kanpur
Diversity Quiz Finals by Quiz Club, IIT KanpurDiversity Quiz Finals by Quiz Club, IIT Kanpur
Diversity Quiz Finals by Quiz Club, IIT Kanpur
 
IoT (Internet of Things) introduction Notes.pdf
IoT (Internet of Things) introduction Notes.pdfIoT (Internet of Things) introduction Notes.pdf
IoT (Internet of Things) introduction Notes.pdf
 
Diversity Quiz Prelims by Quiz Club, IIT Kanpur
Diversity Quiz Prelims by Quiz Club, IIT KanpurDiversity Quiz Prelims by Quiz Club, IIT Kanpur
Diversity Quiz Prelims by Quiz Club, IIT Kanpur
 
INTRODUCTION TO HOSPITALS & AND ITS ORGANIZATION
INTRODUCTION TO HOSPITALS & AND ITS ORGANIZATION INTRODUCTION TO HOSPITALS & AND ITS ORGANIZATION
INTRODUCTION TO HOSPITALS & AND ITS ORGANIZATION
 
Observational Learning
Observational Learning Observational Learning
Observational Learning
 
Erasmus + DISSEMINATION ACTIVITIES Croatia
Erasmus + DISSEMINATION ACTIVITIES CroatiaErasmus + DISSEMINATION ACTIVITIES Croatia
Erasmus + DISSEMINATION ACTIVITIES Croatia
 
78 Microsoft-Publisher - Sirin Sultana Bora.pptx
78 Microsoft-Publisher - Sirin Sultana Bora.pptx78 Microsoft-Publisher - Sirin Sultana Bora.pptx
78 Microsoft-Publisher - Sirin Sultana Bora.pptx
 
Contiguity Of Various Message Forms - Rupam Chandra.pptx
Contiguity Of Various Message Forms - Rupam Chandra.pptxContiguity Of Various Message Forms - Rupam Chandra.pptx
Contiguity Of Various Message Forms - Rupam Chandra.pptx
 
Opportunity scholarships and the schools that receive them
Opportunity scholarships and the schools that receive themOpportunity scholarships and the schools that receive them
Opportunity scholarships and the schools that receive them
 
nutrition in plants chapter 1 class 7...
nutrition in plants chapter 1 class 7...nutrition in plants chapter 1 class 7...
nutrition in plants chapter 1 class 7...
 
220711130097 Tulip Samanta Concept of Information and Communication Technology
220711130097 Tulip Samanta Concept of Information and Communication Technology220711130097 Tulip Samanta Concept of Information and Communication Technology
220711130097 Tulip Samanta Concept of Information and Communication Technology
 
The basics of sentences session 8pptx.pptx
The basics of sentences session 8pptx.pptxThe basics of sentences session 8pptx.pptx
The basics of sentences session 8pptx.pptx
 
Creation or Update of a Mandatory Field is Not Set in Odoo 17
Creation or Update of a Mandatory Field is Not Set in Odoo 17Creation or Update of a Mandatory Field is Not Set in Odoo 17
Creation or Update of a Mandatory Field is Not Set in Odoo 17
 
Non-Verbal Communication for Tech Professionals
Non-Verbal Communication for Tech ProfessionalsNon-Verbal Communication for Tech Professionals
Non-Verbal Communication for Tech Professionals
 
How to Create User Notification in Odoo 17
How to Create User Notification in Odoo 17How to Create User Notification in Odoo 17
How to Create User Notification in Odoo 17
 
The Science of Learning: implications for modern teaching
The Science of Learning: implications for modern teachingThe Science of Learning: implications for modern teaching
The Science of Learning: implications for modern teaching
 
Talking Tech through Compelling Visual Aids
Talking Tech through Compelling Visual AidsTalking Tech through Compelling Visual Aids
Talking Tech through Compelling Visual Aids
 
Library news letter Kitengesa Uganda June 2024
Library news letter Kitengesa Uganda June 2024Library news letter Kitengesa Uganda June 2024
Library news letter Kitengesa Uganda June 2024
 
CapTechTalks Webinar Slides June 2024 Donovan Wright.pptx
CapTechTalks Webinar Slides June 2024 Donovan Wright.pptxCapTechTalks Webinar Slides June 2024 Donovan Wright.pptx
CapTechTalks Webinar Slides June 2024 Donovan Wright.pptx
 
Post init hook in the odoo 17 ERP Module
Post init hook in the  odoo 17 ERP ModulePost init hook in the  odoo 17 ERP Module
Post init hook in the odoo 17 ERP Module
 

LIST IN PYTHON

  • 1. [DECLARATION AND INTIALIZATION OF LIST] COMPUTER SCIENCE(083) CLASS: XII LIST IN PYTHON PART-1
  • 2. What is List? How we declare a List? How we initialize a List? Different methods of initializing list.
  • 3. WHAT IS LIST: A list is a collection of values or an ordered sequence of values. Values in the list can be Elements of a list enclosed in a square brackets [ ], separated by commas (,) . Syntax: list_name= [value1, value2,……..,valueN] Example: No_list = [ 10, 20, 30, 40, 50 ]
  • 4. HOW TO CREATE AND INITIALIZE LIST Method 1: If list is declare empty. list1=[ ] Method 2: Initialize list with value: If we want to store the numbers in a list. list2= [10, 20, 30, 40, 50] If we want to store the words or string in a list. list3= [“Mango”, “Apple”,”Grapes”,”Oranges”]
  • 5. HOW TO CREATE AND INITIALIZE LIST If we want to store the characters in a list. list4= [‘A’,’E’,’I’,’O’,’U’] If we want to store the mixed information in a list. list4= [“Kapil”, 13,”Class-IX”, 40]
  • 6. TO DISPLAY THE LIST Example: list2= [10, 20, 30, 40, 50] print(list2) ----------------Output------------- [10, 20, 30, 40, 50] Example: list3= [“Mango”, “Apple”,”Grapes”,”Oranges”] print(list3) ----------------Output------------- [‘Mango’, ‘Apple’, ’Grapes’, ’Oranges’]
  • 7. HOW TO CREATE AND INITIALIZE THE LIST USING LIST() CONSTRUCTOR Syntax: list_name=list(sequence or string) Example: list1=list(‘Computer’) print(list1) ----------output---------- [‘C’,’o’,’m’,’p’,’u’,’t’,’e’,’r’] If we want to store the characters in a list. list4= list((‘A’,’E’,’I’,’O’,’U’)) ---------Output---------- [‘A’, ‘E’,’I’,’O’,’U’]
  • 8. HOW TO CREATE AND INITIALIZE THE LIST USING LIST() CONSTRUCTOR Example: If we want to store the mixed information in a list. list4= list((“Kapil”, 13,”Class-IX”, 40)) ----------------Output------------- [‘Kapil’, 13,’Class-IX’, 40] Example: If we want to store the numbers in a list. List_=list((10, 20, 30, 40, 50)) ----------------Output------------- [10, 20, 30, 40, 50]
  • 9. HOW USER ENTER THE VALUES IN A LIST AT RUN TIME Using input() function how we can enter the number inside the list. If we want to enter number 1,2,3,4,5,6,7,8,9 using keyboard at the run time Example: no=list(input(“Enter the no”)) print(no) -----------Output------------- [‘1’,’2’,’3’,’4’,’5’,’6’,’7’,’8’,’9’] These numbers are store in a character format as these numbers are display in ‘1’ format.
  • 10. We can use eval( ) method, which identifies the data type and evaluate them automatically. Example: no=eval(input(“Enter the no:”)) print(no) -------Input----------- Enter the no: [1,2,3,4,5,6,7,8,9] -----------Output------------- [1,2,3,4,5,6,7,8,9] -------Input----------- Enter the no: 1,2,3,4,5,6,7,8,9 -----------Output------------- (1,2,3,4,5,6,7,8,9) If you enter the number with square brackets it will create List If you enter the number without square brackets it will create tuple
  翻译: