In [1]:
1+1


Out[1]:
2

In [2]:
1*3


Out[2]:
3

In [3]:
5/5


Out[3]:
1

In [4]:
1/2.0


Out[4]:
0.5

In [5]:
2**3


Out[5]:
8

In [6]:
(2 + 3) * (5 + 5)


Out[6]:
50

In [7]:
4%2


Out[7]:
0

In [8]:
5%2


Out[8]:
1

In [15]:
x  =  4
y = 16
z = y/x
print(z)


4

In [ ]:
x = 2 
y = 10
z = y/x
print(z)

In [16]:
y


Out[16]:
16

In [17]:
x


Out[17]:
4

In [18]:
y/x


Out[18]:
4

In [19]:
# strings
name = "shashank ragireddy"
print(name)


shashank ragireddy

In [20]:
course = "Engineering"
print("My name is {} and i'am an student of {}".format(name,course))


My name is shashank ragireddy and i'am an student of Engineering

In [21]:
s =  "shashank"

In [22]:
s[0]


Out[22]:
's'

In [23]:
s[0:]


Out[23]:
'shashank'

In [26]:
s[:3]


Out[26]:
'sha'

In [27]:
s[:4]


Out[27]:
'shas'

In [28]:
s[0:2]


Out[28]:
'sh'

In [29]:
s[3:5]


Out[29]:
'sh'

In [30]:
s[5:7]


Out[30]:
'an'

In [32]:
my_list = ["a","b","c"]

In [33]:
my_list


Out[33]:
['a', 'b', 'c']

In [34]:
my_list.append('d')

In [35]:
my_list[0:3]


Out[35]:
['a', 'b', 'c']

In [36]:
my_list[:4]


Out[36]:
['a', 'b', 'c', 'd']

In [37]:
my_list[3:4]


Out[37]:
['d']

In [38]:
my_list[2:4]


Out[38]:
['c', 'd']

In [39]:
my_list[0:3]


Out[39]:
['a', 'b', 'c']

In [40]:
my_list[1:3]


Out[40]:
['b', 'c']

In [ ]:
nest=[1,2,[3,4],[5,6],7,8,[9,10],[11,12],13,[14,15,16,17]]
nest

In [ ]:
nest[1]

In [ ]:
nest[3]

In [ ]:
nest[3[1]]

In [ ]:
nest[3][1]

In [ ]:
1 > 3

In [ ]:
1 == 1

In [ ]:
1 != 4

In [ ]:
1==1 and 2 >3

In [ ]:
1==1 and 2>4

In [ ]:
1==1 and 2>1

In [ ]:
if 2 > 1:
    print('2 is greater than 1')

In [ ]:


In [ ]:


In [ ]:
2>4

In [ ]:
if 10 > 5:
    print('greater')

In [ ]:


In [ ]:
x = 5

if x > 5:
    print('The value is greater than 5')
if x < 5: 
    print('The value is less than 5')
else:
    print('The value is equal')

In [ ]:
x = 5

if x > 5:
    print('The value is greater than 5')
if x < 5: 
    print('The value is less than 5')
else:
    print('The value is equal')

In [ ]:


In [ ]: