Skip to content

Python Basics

print(7 + 10)

13

Why we use python

  • You want to do some quick calculations.
  • For your new business, you want to develop a database-driven website.
  • Your boss asks you to clean and analyze the results of the latest satisfaction survey.

Operators

Operator Description Syntax
+ Addition: adds two operands x+y
- Subtraction: subtracts two operands x-y
* Multiplication: multiplies two operands x*y
/ Division (float): divides the first operand by the second x/y
// Division (floor): divides the first operand by the second x//y
% Modulus: returns the remainder when first operand is divided by the second x%y
****** Expnentiation : raises the number to its left to the power of the number to its right x****y

Variables & Types

a=1.0
print(type(a))

  • int()
  • float()
  • str()
  • bool()