# Basic Syntax in python3

Variables in Python3

```counter = 100          # An integer assignment
miles   = 1000.0       # A floating point
name    = "John"       # A string

print (counter)
print (miles)
print (name)

a = b = c = 1

print(a,b,c)

x, y, z = 1, 2, "john"

print(x,y,z)

del x,y,z
```

Output :

Arithmetic Operation in Python3

```a = 2
b = 3
print(a + b)
print(a - b)
print(a * b)
print(b / a)
print(b % a)
print(a ** b)
print(b // a)
```

Output :

Python Comparison Operator :

```a = 10
b = 20
print(" a == b : {0}".format(a==b))
print(" a != b : {0}".format(a!=b))
print(" a > b : {0}".format(a>b))
print(" a < b : {0}".format(a<b))
print(" a >= b : {0}".format(a>=b))
print(" a <= b : {0}".format(a<=b))

```

Output :

Python Logical Operators

```a = True
b = False
print (a and b)
print (a or b)
```

Output :

Membership operator in Python

```a = 10
b = 20
list = [20,40,60]

if(a in list):
print("{0} is present in list".format(a))
else:
print("{0} is not present in list".format(a))

if(b in list):
print("{0} is present in list".format(b))
else:
print("{0} is not present in list".format(b))
```

Output :

is Operator in Python

```a = 20
b = 20
if (a is b):
print('Id of a and b are same : a id : ',id(a),' b id : ',id(b))
else:
print('Id of a and b are not same : a id : ',id(a),' b id : ',id(b)))
```

Output :

If elif else in Python3

```amount = 2000

if amount<1000:
discount = amount*0.05
print ("Discount",discount)
elif amount<5000:
discount = amount*0.10
print ("Discount",discount)
else:
discount = amount*0.15
print ("Discount",discount)

print ("Net payable:",amount-discount)
```

Output :