Python

>>> stack = [11,22,33,44,55,66,77] >>> stack.append(88) >>> stack [11, 22, 33, 44, 55, 66, 77, 88] >>> stack.append(99) >>> stack [11, 22, 33, 44, 55, 66, 77, 88, 99] >>> stack.pop() 99 >>> stack.pop() 88 >>> stack.pop() 77 >>> stack.pop() 66 >>> stack [11, 22, 33, 44, 55]

Python list >>> arr = [22, 33, 44, 55, 66, 77, 1, 2, 3, 4, 5, 6] >>> arr [22, 33, 44, 55, 66, 77, 1, 2, 3, 4, 5, 6] >>> arr.index(2) 7 >>> arr.remove(77) >>> arr [22, 33, 44, 55, 66, 1, 2, 3, 4, 5, 6] >>> arr.reverse() >>> arr [6, 5,
Read More

Keywords Keywords are the reserved words in Python. We cannot use a keyword as variable name, function name or any other identifier. They are used to define the syntax and structure of the Python language. In Python, keywords are case sensitive. Python is a dynamic language. It changes during time. The list of keywords may
Read More

$ vim zendanwar.py #!/usr/bin/python # Hello world python program print “Hello python World!” save the the file Make the permission with following comman $ chmod +x zendanwar.py lastly run your file $ zendanwar.py output : Hello python World!

>>> sorted([5, 2, 3, 1, 4,8,9,7]) output : [1, 2, 3, 4, 5, 7, 8, 9] list.sort() method : >>> a= [5, 2, 3, 1, 4,8,9,7] >>> a.sort() >>> a output : [1, 2, 3, 4, 5, 7, 8, 9] Key Functions : >>> sorted(“a key parameter to specify a function to be called on
Read More