Kernel: Python 3
Elements of a Programming Language:
Alphabet
Dictionary
Syntax
Semantics
Literals/Types:
Boolean (True, False)
Integer (1, 2, 3, 4, 5)
Float (1.0, 3.14, 9.67)
String ("This is a string too",'This is also a string')
Scientific notation (1e10)
Comments
Single line (#)
Multiple Lines (""" """)
""" This is a comment """
Help Command
dir(print)
help(print)
Print Aestericks (*) Seperator Between Alphabets
In [3]:
Out[3]:
a*b*c
Print Alphabets with a single tab/space in between
In [6]:
Out[6]:
a b c
Input Command Function and its Input Types
help(input)
String Input
In [9]:
Out[9]:
Input Something Please: This is a test
<class 'str'>
Integer Input
In [10]:
Out[10]:
Please enter number of Apples required: 10
<class 'int'>
Numerical Types:
Binary -> 0b1101
Octal -> 0o12354
Decimal -> 1212
Hexadecimal -> 0x1ae
In [19]:
Out[19]:
101112
In [18]:
Out[18]:
5
In [20]:
Out[20]:
27
In [21]:
Out[21]:
65518
Numeric Operations Types:
In [23]:
Out[23]:
4
In [24]:
Out[24]:
6
In [25]:
Out[25]:
2.0
In [26]:
Out[26]:
2
In [27]:
Out[27]:
1
In [28]:
Out[28]:
5
In [29]:
Out[29]:
-3
In [30]:
Out[30]:
---
Using Strings with Operators
In [31]:
Out[31]:
LovingDublin
In [32]:
Out[32]:
PwnedPwnedPwnedPwnedPwned
In [33]:
Out[33]:
*************************
Assginments and Shortcuts:
In [37]:
Out[37]:
1