1 / 25

Python Sequence | Python Lists | Python Sets & Dictionary | Python Strings | Python Training | Edureka

This Edureka Python tutorial will help you in learning various sequences in Python - Lists, Tuples, Strings, Sets, Dictionaries. It will also explain various operations possible on them. Below are the topics covered in this tutorial: <br><br>1. Python Sequences <br>2. Python Lists <br>3. Python Tuples <br>4. Python Sets <br>5. Python Dictionaries <br>6. Python Strings

EdurekaIN
Download Presentation

Python Sequence | Python Lists | Python Sets & Dictionary | Python Strings | Python Training | Edureka

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. EDUREKA PYTHON CERTIFICATION TRAINING Python Sequences www.edureka.co/python

  2. Agenda ➢ What are sequences? ➢ Sequence Operations ➢ Types of Sequences in Python ➢ Lists ➢ Tuples ➢ Strings ➢ Sets ➢ Dictionaries www.edureka.co/python EDUREKA PYTHON CERTIFICATION TRAINING

  3. What are Sequences? www.edureka.co/python EDUREKA PYTHON CERTIFICATION TRAINING

  4. What Are Sequences? ➢ Sequences are containers with items that are accessible by indexing or slicing. ➢ The built-in len function takes any container as an argument and returns the number of items in the container. Sequence of Cars www.edureka.co/python EDUREKA PYTHON CERTIFICATION TRAINING

  5. Sequences Operations www.edureka.co/python EDUREKA PYTHON CERTIFICATION TRAINING

  6. Sequence Operations Repetition Membership Testing Slicing Indexing Concatenation Sequences of Cars www.edureka.co/python EDUREKA PYTHON CERTIFICATION TRAINING

  7. Sequence Concatenation and Repetition Concatenation Repetition Sequence of Cars www.edureka.co/python EDUREKA PYTHON CERTIFICATION TRAINING

  8. Sequence Membership Testing Membership Testing Sequence of Cars Not a member Is a member www.edureka.co/python EDUREKA PYTHON CERTIFICATION TRAINING

  9. Sequence Indexing Indexing Sequence of Cars Index 6 Index 7 Index 0 Index 1 Index 2 Index 3 Index 4 Index 5 www.edureka.co/python EDUREKA PYTHON CERTIFICATION TRAINING

  10. Sequence Slicing Slicing Sequence of Cars [ index 1 – index 4 ] www.edureka.co/python EDUREKA PYTHON CERTIFICATION TRAINING

  11. Types of Sequences in Python www.edureka.co/python EDUREKA PYTHON CERTIFICATION TRAINING

  12. Sequences In Python Lists Strings Dictionaries Tuples Sets www.edureka.co/python EDUREKA PYTHON CERTIFICATION TRAINING

  13. Lists www.edureka.co/python EDUREKA PYTHON CERTIFICATION TRAINING

  14. Lists The list is a most versatile datatype available in Python which can be written as a list of comma-separated values (items) between square brackets. Important thing about a list is that items in a list need not be of the same type. Append List.append(elem) Fruits = ['Mango', 'Apple', 'Grapes'] Insert List.insert(index,elem) List.extend(list2) Extend List.index(elem) Index Remove List.remove(elem) Sort List.sort() Reverse List.reverse() www.edureka.co/python EDUREKA PYTHON CERTIFICATION TRAINING

  15. Tuples www.edureka.co/python EDUREKA PYTHON CERTIFICATION TRAINING

  16. Tuples ➢ A tuple is a sequence of immutable Python objects. ➢ Tuples are sequences, just like lists. The differences between tuples and lists are, the tuples cannot be changed unlike lists and tuples use parentheses. Fruits = ('Mango', 'Apple', 'Grapes‘) Tuple.index(elem) Index Tuple[range] Slicing Tuple1+Tuple2 Concatenation Tuple * x Repetition Tuple.count(elem) Count www.edureka.co/python EDUREKA PYTHON CERTIFICATION TRAINING

  17. Strings www.edureka.co/python EDUREKA PYTHON CERTIFICATION TRAINING

  18. Strings ➢ We can create them simply by enclosing characters in quotes. ➢ Python treats single quotes the same as double quotes. Fruits = 'Mango Apple Grapes' Slicing String[range] String[range] + ‘x’ Updating String 1 + String 2 Concatenation String 1 * x Repetition Membership In, not in String [:-1] Reverse www.edureka.co/python EDUREKA PYTHON CERTIFICATION TRAINING

  19. Sets www.edureka.co/python EDUREKA PYTHON CERTIFICATION TRAINING

  20. Sets ➢ A set contains an unordered collection of unique and immutable objects. ➢ The set data type is, as the name implies, a Python implementation of the sets as they are known from mathematics. Fruits = {'Mango', 'Apple', 'Grapes‘} B A A B A B C Difference Slicing (A C) / B (B C) / A Add Element Discard C Clear Remove Copy Intersection www.edureka.co/python EDUREKA PYTHON CERTIFICATION TRAINING

  21. Dictionaries www.edureka.co/python EDUREKA PYTHON CERTIFICATION TRAINING

  22. Dictionaries ➢ Dictionary is an unordered collection of key-value pairs. ➢ It is generally used when we have a huge amount of data. Length Value Example: del d [K] Membership Testing Key www.edureka.co/python EDUREKA PYTHON CERTIFICATION TRAINING

  23. Session In A Minute Tuples Lists What are Sequences? Dictionaries Strings Sets www.edureka.co/python EDUREKA PYTHON CERTIFICATION TRAINING

  24. Thank You … Questions/Queries/Feedback www.edureka.co/python EDUREKA PYTHON CERTIFICATION TRAINING

More Related