This document outlines exercises for a Python programming laboratory course. It includes definitions for common computer science terms and lists Linux shell commands for file management, system information, and permissions. It also provides instructions for using the Python interactive mode to define and operate on variables of different data types, perform calculations, and output strings. Students are asked to create directories and files using shell commands and experiment with Python variables, types, expressions, and string formatting.
This document outlines exercises for a Python programming laboratory course. It includes definitions for common computer science terms and lists Linux shell commands for file management, system information, and permissions. It also provides instructions for using the Python interactive mode to define and operate on variables of different data types, perform calculations, and output strings. Students are asked to create directories and files using shell commands and experiment with Python variables, types, expressions, and string formatting.
Ex 1: Linux Shell Commands & Python in Interactive Mode
Define the following terms:
1. Computer 2. Hardware 3. Software 4. Types of Software 5. Machine level language 6. Assembly level language 7. High level language 8. Operating systems 9. Compiler 10. Interpreter 11. Editor 12. Shell
Linux Shell Commands:
1. File and directory commands a. ls, ls -l b. cd, cd .. c. mkdir d. cat (displaying, creating, appending options) e. cp f. mv g. chmod h. wc i. find 2. System related commands a. who b. whoami c. pwd d. date e. man f. echo g. cal h. bc
3. Create a new directory named “SSN”, a subdirectory "BE" under SSN and create a file named “firstyear.txt” and write about the SSN orientation programme.
4. Rename the firstyear.txt file as orientation.txt
5. Give all permissions to user and only reading permission to others
6. Create a file "AboutMe.txt". Write about yourself and your ambitions.
Working in Python Interactive Mode:
1. Create a variable named num1 with some integer value.
2. Create another variable named num2 with some float value. 3. Create a variable name with your name as input. 4. Display the value of num1, num2 and name. 5. Display the type of num1, num2 and name. 6. Say “Hello “ to name. 7. Find the output of 4+6*7 /2 directly. 8. Find the output of 4+5*7 /3 directly. 9. Find the output of 4+5*7 //3 directly. 10. Find the output of num1 raised to power of num2.