GK SCIENTIST

General Knowledge One Stop Source
Menu
  • Home
  • Social Science
    • History
    • Political Science
    • Geography
  • Science
    • Physics
    • Chemistry
    • Biology
  • Chemistry Notes
  • Mathematics
  • Computer
  • Tutorial MySQL
  • Tutorial Python
  • Java Tutorial
  • English Grammar
  • English Essay
  • Indian Anthropology
  • Philosophy
  • Solved Paper
  • UPSC
  • Current Content
    • Current Affairs
    • RSTV News
    • Yojana and Kurukshetra Gist
  • Donate
  • Contact Us

If you are interested in advertising to our audience, submit the advertising enquiry form.

Advertising Enquiry
Computer

How to Create List in Python

Gk Scientist November 27, 2022 No Comments
Tweet WhatsApp Telegram

Create List in Python:

We can use the PyCharm code editor for this example. If you do not know about it then follow this link- How to install PyCharm for Python and create a program in it.

(1) In Python, the most basic data structure is the list. The list is similar to an array as in C, C++, or Java since the index of the first element of the list is zero, the second element is one, and so on. However, the list is a collection of heterogeneous data elements. That means a list contains numeric as well as character data. Elements of a list are enclosed in square brackets and are separated by commas. In Python, lists are mutable. It means that the contents of the list can be changed after it has been created. Like strings, the slicing operation can also be applied to lists.

(2) Accessing Elements in a List.

list codeunit in python - How to Create List in Python
  • The first print command shows the index number of the values in the list which need to be displayed as output.
  • The second print command 0:4 shows we need four values from the start.
  • In the third print command 0::3, we need an increment of 3 in the values from the start.
  • The fourth print command 4: define we need all values that start from the index value 4.
  • The fifth print command -1::-3 is similar to the third print command but it is the case of obtaining reverse values.
  • The last print command -1::-1 reverses all values.

Artificial Intelligence (AI)
Cloud Computing
Multimedia and Its Application
Computer Software and Hardware
Careers in Information Technology (IT)
Operating System as a Resource Manager
Python (programming language)– Wikipedia
Prev Article
Next Article

Related Articles

Python SQLite Search Query
Python SQLite Search Query: We can use the PyCharm code …
Gk Scientist December 9, 2022 Computer

Python SQLite Search Query

Programming Languages
Programming Languages: A programming language is a set of rules …
Gk Scientist September 8, 2022 Computer

Programming Languages

Java Random Class
Java Random Class: We can use the Eclipse IDE for …
Gk Scientist January 1, 2023 Computer

Java Random Class

List Iteration in Python
List Iteration in Python: We can use the PyCharm code …
Gk Scientist November 27, 2022 Computer

List Iteration in Python

Linux- Features and Benefits
Linux: In 1984, a project named GNU was launched to …
Gk Scientist October 23, 2022 Computer

Linux- Features and Benefits

Python Conditional Statements
Python Conditional Statements: We can use the PyCharm code editor …
Gk Scientist November 24, 2022 Computer

Python Conditional Statements

Create a Random Number Guessing Game in Python
Create a Random Number Guessing Game in Python: We can …
Gk Scientist December 3, 2022 Computer

Create a Random Number Guessing Game in Python

Create MySQL Database and Connection in Python
Create MySQL Database and Connection in Python: In the previous …
Gk Scientist December 11, 2022 Computer

Create MySQL Database and Connection in Python

Leave a Reply Cancel Reply

Search




  • Popular
  • Recent




GK SCIENTIST

General Knowledge One Stop Source

Information

  • About Us
  • Terms and Condition, Disclaimer
  • Contact Us

Android Apps

  • IAS App For English Medium Students
  • IAS Basics App For English Medium Students
  • IAS Hindi App For Hindi Medium Students
DMCA.com Protection Status

Popular Tags

Biology (33) Biology Questions (88) Chemistry (57) Computer (214) Current Affairs (4) Current Content (0) Economy (10) English Essay (172) English Grammar (75) English Literature (10) Geography (83) History (259) Indian Anthropology (11) Indian Polity (14) JKAS Mains Question Papers (17) Mathematics (68) Moral Science (7) NCERT & Other Boards Books (25) Philosophy (114) Physics (89) Political Science (132) RS TV News (33) Science (553) Social Anthropology (7) Social Science (17) Solved Paper (47) UPSC (7) UPSC Mains Question Papers (26)

Downloads

  • NCERT Books
  • Old NCERT Books
  • NIOS Books For IAS, SSC, and State PSC Exam
  • Tamil Nadu Board Books: Important For UPSC, SSC, and State PSC Exam
  • Modern Indian and World History Notes For IAS Exam
  • UPSC Topper 2013 Gaurav Agrawal Notes For IAS Preparation
  • UPSC IAS Prelims General Studies – Previous Year Papers
  • UPSC Mains Question Papers

Copyright © 2023 GK SCIENTIST
Theme by MyThemeShop.com& Hosted On Cloudways

Ad Blocker Detected

Our website is made possible by displaying online advertisements to our visitors. Please consider supporting us by disabling your ad blocker.

Refresh
 

Loading Comments...