# Python Keywords and Built-in Functions with Examples
## Keywords (partial list with usage):
- **def**: Defines a function. Example: def greet():
- **return**: Returns a value from a function. Example: return x
- **if**: Conditional statement. Example: if x > 0:
- **else**: Alternative branch for if. Example: else:
- **elif**: Else-if branch in conditionals. Example: elif x == 0:
- **while**: Loop while condition is true. Example: while x < 10:
- **for**: Loop over iterable. Example: for i in range(5):
- **in**: Checks membership or used in loops. Example: if x in list:
- **try**: Start of try block for error handling. Example: try:
- **except**: Catch exceptions. Example: except ValueError:
- **finally**: Runs after try/except. Example: finally:
- **class**: Defines a class. Example: class Dog:
- **import**: Imports a module. Example: import math
- **from**: Imports specific names. Example: from math import pi
- **as**: Alias for import. Example: import numpy as np
- **pass**: No operation. Placeholder. Example: pass
- **break**: Exit loop. Example: break
- **continue**: Skip to next iteration. Example: continue
- **with**: Context manager. Example: with open('file') as f:
## Built-in Functions (partial list with usage):
- **print**: Prints output. Example: print('Hello')
- **len**: Returns length. Example: len([1, 2, 3])
- **type**: Returns type. Example: type(5)
- **input**: Takes user input. Example: input('Name: ')
- **range**: Generates sequence. Example: range(5)
- **sum**: Sums iterable. Example: sum([1, 2, 3])
- **max**: Max value. Example: max([3, 5, 2])
- **min**: Min value. Example: min([3, 5, 2])
- **sorted**: Returns sorted list. Example: sorted([3,1,2])
- **map**: Applies function. Example: map(str, [1, 2])
- **zip**: Combines iterables. Example: zip([1,2], ['a','b'])
- **list**: Creates list. Example: list('abc')
- **int**: Converts to integer. Example: int('5')
- **str**: Converts to string. Example: str(5)
- **float**: Converts to float. Example: float('3.14')