In Python, Dictionary is an unordered, indexed collection of data values used to store data in the form of keys and values. Keys must be unique whereas values can be repeated. Only immutable data types like string, tuple, int, etc. can be used as keys. Creating a Dictionary: a) Using a { }: Dictionary can […]
Author: Shivangi Baligar
Python – Strings
In this article, we’ll be covering about Strings in Python. Strings in Python are a sequence of characters enclosed in single-quotes, double-quotes or sometimes in triple-quotes. Output: <class ‘str’> Accessing characters in String: We can access characters in the string by using an index number in the square brackets. Output: H o Iterating through String: […]
Python Lists
The List is a collection of heterogeneous data type that is ordered and changeable i.e. mutable. It allows duplicate members. Creation of list: Using square brackets: Output: [] [‘apple’, ‘orange’, ‘kiwi’] Using list() built-in function: Output: [] [‘a’, ‘p’, ‘p’, ‘l’, ‘e’] Access elements of the list: We can access any element from the list […]
Introduction To Python Programming Language
Python is a general-purpose programming language which is high level, interpreted language with easy syntax and dynamic semantics. It was created by Guido Van Rossum in 1991.