Scripting PYTHON Programming Lab Manual by M Murali Mohan Reddy
Scripting PYTHON Programming Lab Manual by M Murali Mohan Reddy
SCRIPTING
(PYTHON)
PROGRAMMING LAB
MCA-I Year – II Sem LAB MANUAL
Prepared by:
Mr. M. Murali Mohan Reddy
Assistant Professor
Computer Science Department
SCRIPTING (PYTHON) PROGRAMMING LAB 2017
1) Write a program to demonstrate different number data types in Python.
Choose Start menu on windows and select “Python 3.6.4 IDLE” then it will display a Python
3.6.4 Shell –window
Click on File menu and choose “New File” option for creating a new shell script python file
Output
Output
Output
Output
Output
Seventh_experiment.py (code)
print(my_dict['name'])
print(my_dict.get('age'))
# update value
my_dict['age'] = 27
print(my_dict)
# add item
my_dict['address'] = 'Downtown'
print(my_dict)
# create a dictionary
print(squares.pop(4)) # Output: 16
del squares[1]
squares.clear()
print(squares)# Output: {}
del squares
marks = {}.fromkeys(['Math','English','Science'], 0)
print(marks)
print(list(sorted(marks.keys())))
Output
Output
Output
Output
Output
Output
fibo.py
fourteenth_experiment.py
Output
fibo1.py
fifteenth_experiment.py
Output
input.txt
copyfile.py
output.txt
input1.txt
seventeenth_experiment.py
Output
Output
Output
Output