Jermi Python
Jermi Python
PYTHON ASSIGNMENT.
FACULTY OF COMPUTING AND INFORMATICS
MIREMBE JEREMIAH ARNN 2023/BIT/148/PS
4. Explain the concept of variables and how they are used in Python.
A variable in Python is a name that is assigned to a value.
Variables are used to store data that can be refered to and manipulated later in the block of code.
A value is assigned to a variable using the operator =.
5. What are operators and their types in Python? Give examples of arithmetic, comparison,
and logical operators.
Operators are special symbols that perform operations on variables. Types of operators are as
follows;
Arithmetic Operators; Do mathematical operations.
+ (Add): 5 + 35
-(Subtract): 5 – 4
*(Multply): 5 * 73
/ (Divide): 5 / 2
% (Modulus): 5 % 2
** (Exponentiation): 5 ** 8
// (Floor Division): 5 // 2
Comparison Operator: Compare value and bring out a boolean result.
== (Equal to): 5 == 5
!= (Not equal to): 5 != 4
(Greater than): 5 > 4
< (Less than): 5 < 6
≥ (Greater than or equal to): 5 >= 4
≤ (Less than or equal to): 5 < =8
Logical Operators: Do logical operations.
And; True and False
Or; True or False
Not: not False
10. What are some common Python development tools and IDEs?
Python development tools and IDEs that are common include:
IDEs;
PyCharm: A full-stocked and featured IDE with advanced debugging, testing, and code
analysing tools.
Visual Studio Code: A lightweight and extensible editor with excellent support for Python.
Spyder: An IDE made for data science containing features for interactive computing.
Jupyter Notebook: An interactive web-based IDE for data analysing and visualization.
Tools;
Pip: A package installer majorly for Python.
Virtualenv: A tool to create multiple isolated Python environments.
Pytest: A framework that is used for writing and running tests.
Black: A code formatter for regular dependable code style.
Flake8: A tool used to check the style and the quality of Python code.