Basic Python Notes
Basic Python Notes
Basic Python Notes
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Language : Communication :
Arithmetic : + - * /...
10 5
15
50
Language :
compilers :
interpreters :
assemblers :
Computer Scientist:
Adobe : cpp..
E<--------------->(E/C)<--------------------->C
Python : HIGH LEVEL, OPEN SOURCE, CASE SENSITIVE, OBJECT ORIENTED, STRONGLY TYPED
PROGRAMMING LANGUAGE..
---------------------------------------------------------------
JAVA : PACKAGES
.NET : NAMESPACES
PYTHON : MODULES..
----------------------------------
Tokens:
Tokens Of python:
1. identifiers : every smallest unit of a program is called an identifier , identified by the programmer,
understandable by the interpreter..
valid:
invalid :
2. keywords : reserved word : already occcupied.;. which internally consists a meaning according to
interpreter
>>> keyword.kwlist
['False', 'None', 'True', 'and', 'as', 'assert', 'async', 'await', 'break', 'class', 'continue', 'def', 'del', 'elif',
'else', 'except', 'finally', 'for', 'from', 'global', 'if', 'import', 'in', 'is', 'lambda', 'nonlocal', 'not', 'or',
'pass', 'raise', 'return', 'try', 'while', 'with', 'yield']
>>>
3. variables:
a variable is called a name given to the memory address to store, retrive and modify a value..
4. Except _ should not use any other special characters in between the literal
Integers
Floating-Point Numbers
Complex Numbers
Strings
List, Set, Tuple, Dictionary
5. operators.
1. Arithmetic
2. Relational
3. Logical
5. Bitwise
6. Identity
7. Membership
Initialization: Is a process of input a value to the variable for the first time
StudentMarks:
'''
Student Marks
Developed by : vamsee
'''
# input part...
campus=input("Enter campus:")
address=input("Enter address:")
# calc.... part
tot=mbz+mp+mc+mip+me
avg=tot/5
# disp part
print("\t\t-----------------------------------------------------------")
print("\t\t-----------------------------------------------------------")
print("\t\t-----------------------------------------------------------")
Simple Programs:
1. Arithmetic
2. Student Marks
4. Electricity bill
5. Telephone Bill
9. Average of 3 numbers