Posts

Showing posts from May, 2023

Advance Functions in Python #04

Advance functions in Python Dictionary   In programming, we use  Dictionaries to Store Key Value Pairs such as user names , addresses , passwords etc. Each Key in a Dictionary is Unique and value can be any of data type including any collection types.     x = {"id" : 100 , "name" : "saman" , "salary" : 50000.00 }                |         |                              |                                   |              key   value                 x["name"]              x["salary"]                      x["id"] Use of Dictionary is we can access values with key s...

Advance Functions In Python #03

Image
 Advance Functions In Python Slicing Collection Data Types Slicing is one of the most important part which in python data types. This Ability allows us to manage Data collections easily.       Collection [start: end: step ]   # this is the basic structure of a slicing technique This is how we Numbering Collection of Data .      Ex :      x = ("apple","banana","berry",  45, 56.2 ,True)                              0               1               2          3      4        5 Extracting a sub collection starting from index start to index end -1 taking increments os step The extracted elements will satisfy the following conditions, the indexes will be  >= start < end increment step Lets take a l...

Advance Functions in Python #02

Image
 Advanced Functions in Python While / For / Range commands we can use While /For commands to loop some functions or calculations several times. let's take a look that how they work in practically.   While loop For loop In the case we using for loop I will add rage command. Range command can define a range of a list / tuple / etc. NOTE:      In For loop We don't need to define a value for I (variable we using)                     In Range Command We Define (starting value here , End Value here ) Item Function we can use function called Item for define the values of a dictionary /list/tuple etc... In this case, we don't even want to define a variable.  

Advance Functions In Python #01

Image
 Advance Functions in Python Lists & Tuples lists and Tuples are collection data types, that allow you to store multiple items in a single variable. you can have data of different types in lists and tuples. Ex:      xlist = ["apple", "banana", "berry", 45, 56.2, True]               xtuple =  ("apple", "banana", "berry", 45, 56.2, True) NOTE: In list, we use [ ] brackets and in Tuples, we use ( ) brackets. Note: Lists are Mutable which means we can change the values as we want In Tuples we can't Modify values as we want after programming. So We Defined tuples as  Immutable .  Hint: Use http://replit.com  for practise your coding skills