In [3]:
#comments in Python
'''multiple lines of comments are being shown here'''


Out[3]:
'multiple lines of comments are being shown here'

Important

this is a markdown and not a code window


In [1]:
2+3+5


Out[1]:
10

In [2]:
66-3-(-4)


Out[2]:
67

In [3]:
32*3


Out[3]:
96

In [4]:
2**3


Out[4]:
8

In [5]:
2^3


Out[5]:
1

In [6]:
43/3


Out[6]:
14.333333333333334

In [7]:
43//3


Out[7]:
14

In [8]:
43%3


Out[8]:
1

In [9]:
import math as mt

In [10]:
mt.exp(2)


Out[10]:
7.38905609893065

In [11]:
mt.log(10)


Out[11]:
2.302585092994046

In [12]:
mt.exp(1)


Out[12]:
2.718281828459045

In [14]:
mt.log(8,2)


Out[14]:
3.0

In [15]:
mt.sqrt(1000)


Out[15]:
31.622776601683793

In [17]:
import numpy as np

In [18]:
np.std([23,45,67,78])


Out[18]:
21.123150806638673

In [20]:
dir(mt)


Out[20]:
['__doc__',
 '__loader__',
 '__name__',
 '__package__',
 '__spec__',
 'acos',
 'acosh',
 'asin',
 'asinh',
 'atan',
 'atan2',
 'atanh',
 'ceil',
 'copysign',
 'cos',
 'cosh',
 'degrees',
 'e',
 'erf',
 'erfc',
 'exp',
 'expm1',
 'fabs',
 'factorial',
 'floor',
 'fmod',
 'frexp',
 'fsum',
 'gamma',
 'gcd',
 'hypot',
 'inf',
 'isclose',
 'isfinite',
 'isinf',
 'isnan',
 'ldexp',
 'lgamma',
 'log',
 'log10',
 'log1p',
 'log2',
 'modf',
 'nan',
 'pi',
 'pow',
 'radians',
 'sin',
 'sinh',
 'sqrt',
 'tan',
 'tanh',
 'trunc']

In [21]:
type(1)


Out[21]:
int

In [22]:
type("Ajay")


Out[22]:
str

In [24]:
type([23,45,67])


Out[24]:
list

In [25]:
a=[23,45,67]

In [32]:
len(a)


Out[32]:
3

In [31]:
np.std(a)


Out[31]:
17.962924780409974

In [28]:
np.var(a)


Out[28]:
322.66666666666669

In [30]:
123456789123456789*9999999999999999


Out[30]:
1234567891234567766543210876543211

In [35]:
np.random??

In [37]:
from random import randrange,randint

In [39]:
print(randint(0,90))


78

In [42]:
randrange(1000)


Out[42]:
286

In [46]:
for x in range(0,10):
    print(randrange(10000000000000000))


2472965195555081
6352816454724336
4809973335770632
5246909950815852
6348106781629098
2586909203145681
2509370301745813
4082241628288070
7691514263873286
8069700113941950

In [51]:
def mynewfunction(x,y):
    taxes=((x-1000000)*0.35+100000-min(y,100000))
    print(taxes)

In [53]:
mynewfunction(2200000,300000)


420000.0

In [54]:
import os as os

In [57]:
os??

In [62]:
for x in range(0,30,6):
    print(x)


0
6
12
18
24

In [63]:
def mynewfunction(x,y):
    z=x**3+3*x*y+20*y
    print(z)

In [65]:
for x in range(0,30,6):
    mynewfunction(x,10)


200
596
2288
6572
14744

In [ ]: