Category: python
-
running jupyter notebook
activate your virtual environment like if on windows .\pythonfundamental_venv\Scripts\activate the below command will prompt you to select the target like chrome, firefox etc and . is the path that current directory where the jupyter notebook is saved.
-
Python virtual environment
the below command to activate virtual environment venv – environment name tts-venv to create a python virtual environment – example python -m tts-venv for creating virtual environment in windows the command to create virtual environment is same, but to activate the command is like below for powershell the above command may not work and you…
-
python data types
Python has the following data types built-in by default, in these categories: Text Type: str Numeric Types: int, float, complex Sequence Types: list, tuple, range Mapping Type: dict Set Types: set, frozenset Boolean Type: bool Binary Types: bytes, bytearray, memoryview None Type: NoneType
-
python – unpack a collection
If you have a collection of values in a list, tuple etc. Python allows you to extract the values into variables. This is called unpacking. This is also called de-structuring in javascript. example
-
Python Variables – Assign Multiple Values
Python allows you to assign values to multiple variables in one line:
-
python type casting
though not necessary to declare the type of variable, but it can be casted to a specific type. example below
-
python comment
python comment starts with # Since Python will ignore string literals that are not assigned to a variable, you can add a multiline string (triple quotes) in your code, and place your comment inside it:
-
Python Indentation
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. The number of spaces is up to you as a programmer, the most common use is four, but it has to be at least one. example