Free Python Course
Kanalga Telegram’da o‘tish
Ko'proq ko'rsatish
5 967
Obunachilar
Ma'lumot yo'q24 soatlar
-357 kun
-22530 kun
Postlar arxiv
5 967
ELSE STATEMENT
The else statement will execute only when all conditions will be false
1. If condition1 evaluates to true, code block 1 is executed.
2.If condition2 is false, code block 3 is executed.
5 967
ELIF STATEMENT
The elif keyword is Python's way of saying "if the previous conditions were not true, then try this condition".
5 967
INDENTATION
Indentation refers to the spaces at the beginning of a code line. Where in other programming languages the indentation in code is for readability only,
The indentation in Python is very important. Python uses indentation to indicate a block of code.
5 967
INDENTATION
Indentation refers to the spaces at the beginning of a code line. Where in other programming languages the indentation in code is for readability only,
The indentation in Python is very important. Python uses indentation to indicate a block of code.
5 967
IF STATEMENT
The if statement is a conditional statement in python, that is used to determine whether a block of code will be executed or not.
Meaning if the program finds the condition defined in the if statement to be true, it will go ahead and execute the code block inside the if statement.
5 967
PYTHON CONDITIONS
Python supports the usual logical conditions from mathematics:
Equals : a == b
Not Equals: a != b
Less than : a < b
Less than or equal to: a <= b Greater than: a > b
Greater than or equal to : a >= b
These conditions can be used in several ways, most commonly in "if statements" and loops.
5 967
WHAT IS CONDITIONAL STATEMENT ?
A conditional statement as the name suggests itself, is used to handle conditions in your program.
These statements guide the program while making decisions based on the conditions encountered by the program.
Python has 3 key Conditional Statements that you should know: if statement. if-else statement.
5 967
UPDATE METHOD IN SET
x = {"Code", "With", "Rushi"}
y = {"Learn", "Coding", "Easily"}
x.update(y)
print(x)
Output:
{'Easily', 'With', 'Learn', 'Rushi', 'Code', 'Coding'}5 967
UNION METHOD IN SET
x = {"Code", "With", "Rushi"}
y = {"Learn", "Code", "Easily"}
z = x.union(y)
print(z)
Output:
{'Code', 'Rushi'}5 967
SYMMETRIC_DIFFERENCE_UPDATE METHOD IN SET
x = {"apple", "banana", "cherry"}
y = {"google", "microsoft", "apple"}
x.symmetric_difference_update(y)
print(x)
Output:
{'microsoft', 'google', 'cherry', 'banana'}5 967
SYMMETRIC_DIFFERENCE METHOD IN SET
x = {"apple", "banana", "cherry"}
y = {"google", "microsoft", "apple"}
z=x.symmetric_difference(y)
print(z)
Output:
{'google', 'microsoft', 'cherry', 'banana'}5 967
REMOVE METHOD IN SET
data = {"Code", "With", "Rushi"}
data.remove("With")
print(data)
Output:
{'Code', 'Shani'}5 967
POP METHOD IN SET
data = {"Code", "With", "Rushi"}
data.pop()
print(data)
Output:5 967
ISSUPERSET METHOD IN SET
x = {"f", "e", "d", "c", "b", "a"}
y = {"a", "b", "c"}
z = x.issuperset(y)
print(z)
Output:
Truw5 967
ISSUBSET METHOD IN SET
x = {"a", "b", "c"}
y = {"f", "e", "d", "c", "b", "a"}
z = x.issubset(y)
print(z)
Output:
True