DataScience Classroomnotes 09/Mar/2022

Data Structures in Python

  • Iterators in python

| Iterator | Example |
| ———| ——–|
| range(start, stop, [step]) | range(1,10,3) |
| list | [1,2,”test”, false]|
| tuple | (1,2,3,4,5) |
| dictionary | qt = { ‘python’: ‘khaja’, ‘testing’: ‘Ramana’ } |
| set | { 1,2,3} |

  • Think of a data structure from the above which we can use as a shopping cart where we have name of the item and price of the item.
  • To solve this we can use dictionary.
  • I want you to accomodate quantity as well.
  • Refer Here for the python

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.

About continuous learner

devops & cloud enthusiastic learner