We've been learning about sequences in Python but now we're going to switch gears and learn about mappings in Python. If you're familiar with other languages you can think of these Dictionaries as hash tables. This section will serve as a brief introduction to dictionaries and consist of: 1.) Constructing a Dictionary 2.) Accessing objects … Continue reading Dictionaries in Python
Tag: PYTHON 3
Variable Assignment
Rules for variable names names can not start with a number names can not contain spaces, use _ intead names can not contain any of these symbols: :'",<>/?|\!@#%^&*~-+ it's considered best practice (PEP8) that names are lowercase with underscores avoid using Python built-in keywords like list and str avoid using the single characters l (lowercase … Continue reading Variable Assignment
Booleans in Python(Comparison operators)
For the following quiz questions, we will get a preview of comparison operators. In the table below, a=3 and b=4. Operator Description Example == If the values of two operands are equal, then the condition becomes true. (a == b) is not true. != If values of two operands are not equal, then condition becomes … Continue reading Booleans in Python(Comparison operators)
enumerate() function in python
There are many situations where we'll need to iterate over multiple lists in tandem, such as this one: In the example above, we have two lists. The second list describes the viciousness of the animals in the first list. A Dog has a viciousness level of 1, and a SuperLion has a viciousness level of 10. We want to retrieve the position of the item in animals the loop … Continue reading enumerate() function in python
VARIABLES IN PYTHON
Unlike other programming language, Declaring variable in python is very easy, In python variable is created at the moment you assign a value to it. And variable can be of any data type. Example: Variable can be of any data type. Rules for Variable Names A variable can have a short name (like x and … Continue reading VARIABLES IN PYTHON
FUNCTION IN PYTHON
Functions are block of codes that are designed to perform specific task .In this chapter you will study everything about function. If you have to perform a task multiple times throughout, so instead of writing code again and again you can define a function for this task and can call that function whenever we want … Continue reading FUNCTION IN PYTHON



