Menu
Home
Python
HTML
Guide-css
JarvaScript
C
C++
C#
Java
PHP
TypeScript
Go
Swift
Kotlin
Rust
Ruby
Computer Science
News
Market Intel
Donate
User Account
Admin
Python
Search
Welcome to python.
Keywords
False – Boolean false value
None – Represents “no value” / null
True – Boolean true value
and – Logical AND
as – Creates an alias (mainly for imports & exceptions)
assert – Debug check; raises error if condition is false
async – Marks asynchronous function block
await – Waits for an async operation
break – Exits the nearest loop
class – Defines a class
continue – Skips to next loop iteration
def – Defines a function
del – Deletes a reference, variable, attribute, or list element
elif – “Else if” condition
else – Default branch in conditionals or loops
except – Catches exceptions
finally – Always runs after try/except (cleanup)
for – Loop over an iterable
from – Imports specific items from a module
global – Declares that a variable in a function refers to a global variable
if – Conditional branching
import – Imports a module
in – Membership test; also used in loops
is – Identity comparison (same object in memory)
lambda – Defines anonymous functions
nonlocal – Accesses outer-scope variable (not global)
not – Logical NOT
or – Logical OR
pass – Placeholder statement that does nothing
raise – Raises an exception
return – Returns a value from a function
try – Begins exception-handling block
while – Loop that runs while condition is true
with – Context manager block (safe resource handling)
yield – Returns a generator value from a generator function
Functions
abs() – Absolute value
aiter() – Returns async iterator
all() – True if all elements are truthy
anext() – Returns next value of async iterator
any() – True if any element is truthy
ascii() – ASCII-safe representation
bin() – Convert integer to binary string
bool() – Convert to boolean
breakpoint() – Enter debugger
bytearray() – Mutable byte sequence
bytes() – Immutable byte sequence
callable() – Checks if object is callable
chr() – Unicode char from code point
classmethod() – Class-level method wrapper
compile() – Compiles source to code object
complex() – Creates complex number
delattr() – Deletes attribute from object
dict() – Creates dictionary
dir() – Lists attributes of an object
divmod() – Returns quotient and remainder
enumerate() – Index-value iterator
eval() – Evaluates Python expression
exec() – Executes Python code
filter() – Filters iterable by function
float() – Converts to floating-point number
format() – Formats value
frozenset() – Immutable set
getattr() – Gets attribute of object
globals() – Returns global namespace
hasattr() – Returns True if object has attribute
hash() – Hash value
help() – Shows help text
hex() – Converts integer to hex string
id() – Memory identity
input() – User input
int() – Integer conversion
isinstance() – Instance check
issubclass() – Subclass check
iter() – Returns iterator
len() – Length of object
list() – Creates list
locals() – Local namespace
map() – Applies function to iterable
max() – Maximum value
memoryview() – Memory view object
min() – Minimum value
next() – Gets next iterator value
object() – Base object class
oct() – Octal string
open() – Opens file
ord() – Unicode code point from character
pow() – Exponentiation
print() – Prints to console
property() – Property accessor
range() – Integer sequence object
repr() – Official string representation
reversed() – Reverse iterator
round() – Round number
set() – Creates set
setattr() – Sets attribute
slice() – Slice object
sorted() – Returns sorted list
staticmethod() – Static method wrapper
str() – Converts to string
sum() – Sums iterables
super() – Access parent class
tuple() – Creates tuple
type() – Type of object
vars() – Object namespace
zip() – Pairs elements
Operators
Arithmetic
+ – Addition
- – Subtraction
* – Multiplication
/ – Division
// – Floor division
% – Modulo
** – Exponentiation
Comparison
== – Equal
!= – Not equal
> – Greater than
< – Less than
>= – Greater or equal
<= – Less or equal
Assignment
= – Assignment
+= – Add and assign
-= – Subtract and assign
*= – Multiply and assign
/= – Divide and assign
//= – Floor-divide and assign
%= – Modulo-assign
**= – Power-assign
Logical
and – Logical AND
or – Logical OR
not – Logical NOT
identify
is – Same object
is not – Not same object
Membership
in – In sequence
not in – Not in sequence
Bitwise
& – Bitwise AND
| – Bitwise OR
^ – Bitwise XOR
~ – Bitwise NOT
<< – Shift left
> – Shift right
Important Python Syntax and Instructions
List comprehension – [expr for item in iterable]
Dict comprehension – {key: value for item in iterable}
Set comprehension – {item for item in iterable}
Generator expression – (expr for item in iterable)
Context managers – with open(...) as f:
Decorators – @decorator modifies functions/classes
F-strings – f"Hello {name}" formatted expressions
Type hints – x: int = 10
Walrus operator – (x := value) assignment inside expression
Slice syntax – a[start:stop:step]
Function definition – def name(params):
Class definition – class Name:
Import module – import module
Import specific names – from module import name
Try/Except – error handling blocks
Async function – async def func():
Await expression – await something
Return – send value back from function
Yield – produce generator value
Lambda – inline function: lambda x: x+1
Docstrings – """Function documentation"""
Shebang – #!/usr/bin/env python3
Annotations – type information in functions and variables
? Back to HOME