python
python
python
#7 DICTIONARY
we use..
now if we want to add monika likes CS and delete harsh from the data…
Now if we want to create a new dictionary that has other dictionaries and lists within it..
If different variables have the same data, then they are stored at the same address
Different datatypes:
OPERATORS IN PYTHON
relational operators:
M-2: formula …but keep in mind that using formula here uses an extra bit (a=5, b=6 are both 2 bits
each but a+b is 11 which is 3 bits)
why??->
why?? ->
XOR operator:
10 in binary is 1010
i.e 1010.0000…
101000.0000…
This new binary no. is 40
RIGHT SHIFT:
‘floor’ rounds off the decimal to the lower integer. ‘ceil’ rounds off the decimal to the higher integer. i.e
user input
Now assume we want to use only a part of the char. We can achieve this by calling specific index values:
While loop:
1. Initialisation
3. increment/decrement
Code- result-
Code- result-
For loop:
Code- result-
Code- result-
Code- result-
Code-
for i in range(5):
print(i)
result-
Code- result-
result-
ARRAYS:
When creating arrays, we need to mention the type and the values:
--------------------------------------------------------------------------------------------------------------------------
Say we are creating and printing an integer array with the name ‘vorei’ then the code is:
print(vorei)
--------------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------------
Code-
result-
& to print numbers one by one, we can use or we can use another variable and the name
To make a new array with squares of elements from the old array, we can do:
1. Initialisation
3. increment/decrement
returns error
1. Positional..
positions of variables in functions must be maintained
2. Keyword…
If positions are forgotten we can call&assign variables by keywords
3. Default…
If we don’t pass a value where it is required, then it should take a default value
Ex:
1. 2.
code-
result-
…for this same result we can also implement for loop…
Code-
Result-
‘pass’ is used to skip over a space where some code is mandatory but there is an absence of it
Types of variables:
Types of methods:
Instance, class & static methods. Class and static methods are different.
Finished one-shot telusko video at 37. MySQL Workbench Setup - 06:24:05 … https://youtu.be/YfO28Ihehbk?si=-
kr5_2dPaqgI7tQA&t=23045