In [26]:
# This is a comment
In [34]:
type(2)
Out[34]:
In [35]:
type(2.0)
Out[35]:
In [39]:
type("Double quoted also string")
Out[39]:
In [36]:
type('string')
Out[36]:
In [40]:
type(False)
Out[40]:
In [41]:
a = 'sample'
print(a)
type(a)
Out[41]:
In [42]:
a = ['1','2','3']
type(a)
Out[42]:
In [44]:
b = ('a','2','c')
type(b)
Out[44]:
In [45]:
c = {'a':1,'b':2,'c':3}
type(c)
Out[45]:
In [2]:
2 + 2
Out[2]:
In [4]:
2.0 + 2
Out[4]:
In [5]:
3 + 2.0
Out[5]:
In [6]:
4 - 2
Out[6]:
In [7]:
5 - 3.0
Out[7]:
In [9]:
2 * 3
Out[9]:
In [10]:
2 * 3.0
Out[10]:
In [11]:
3.0 * 6.0
Out[11]:
In [12]:
5 * 0.0
Out[12]:
In [13]:
2 + 3 * 5 + 3
Out[13]:
In [14]:
(2 + 3) * (5 + 3)
Out[14]:
In [15]:
5 / 2
Out[15]:
In [16]:
5 // 2
Out[16]:
In [17]:
5 // 2.0
Out[17]:
In [18]:
5 / 2.0
Out[18]:
In [20]:
5 ** 2
Out[20]:
In [21]:
452 ** 0.5
Out[21]:
In [22]:
4 ** 0.5
Out[22]:
In [23]:
164 ** 0.5
Out[23]:
In [24]:
64 ** 0.5
Out[24]:
In [25]:
10 + 4e2
Out[25]:
In [28]:
print('Hello World')
In [29]:
# You can use single quote or double quotes
print("Hello World")
In [31]:
print("Hello " + "World")
In [32]:
print("Hello"[:3])
In [33]:
print("Hello"[3:])
In [46]:
a = 10
print(a)
In [47]:
a = 10 + 2
print(a)
In [49]:
a = a + 2
print(a)
In [50]:
type(a)
Out[50]:
In [51]:
a = b = 10
print(a)
print(a+b)
In [52]:
a = b = c = 10.5
print(a,b,c)
In [53]:
one, two, three = 1,"two",30.00
print(one)
print(two)
print(three)
In [56]:
number = 1
print(type(number))
str = 'string'
print(type(str))
number = str
print(number)
print(type(number))
In [ ]: