JAWAHARLAL NEHRU TECHNOLOGICAL UNIVERSITY HYDERABAD
CS751PC: PYTHON PROGRAMMING LAB
B.Tech IV Year I Semester (R16)
Prerequisites
Students should install Python on Linux platform.
Course Objectives:
To be able to introduce core programming basics and program design with functions using Python programming language.
To understand a range of Object-Oriented Programming, as well as in-depth data and information processing techniques.
To understand the high-performance programs designed to strengthen the practical expertise.
Course Outcomes:
Student should be able to understand the basic concepts scripting and the contributions of scripting language
Ability to explore python especially the object-oriented concepts, and the built-in objects of Python.
Ability to create practical and contemporary applications such as TCP/IP network programming, Web applications, discrete event simulations List of Programs:
1. Write a program to demonstrate different number data types in Python.
2. Write a program to perform different Arithmetic Operations on numbers in Python.
3. Write a program to create, concatenate and print a string and accessing sub-string from a given string.
4. Write a python script to print the current date in the following format “Sun May 29 02:26:23 IST 2017”
5. Write a program to create, append, and remove lists in python.
6. Write a program to demonstrate working with tuples in python.
7. Write a program to demonstrate working with dictionaries in python.
8. Write a python program to find largest of three numbers.
9. Write a Python program to convert temperatures to and from Celsius, Fahrenheit. [ Formula: c/5 = f-32/9]
10. Write a Python program to construct the following pattern, using a nested for loop * ** *** **** ***** **** *** R16 B.TECH IT ** *
11. Write a Python script that prints prime numbers less than 20.
12. Write a python program to find factorial of a number using Recursion.
13. Write a program that accepts the lengths of three sides of a triangle as inputs. The program output should indicate whether or not the triangle is a right triangle (Recall from the Pythagorean Theorem that in a right triangle, the square of one side equals the sum of the squares of the other two sides).
14. Write a python program to define a module to find Fibonacci Numbers and import the module to another program.
15. Write a python program to define a module and import a specific function in that module to another program.
16. Write a script named copyfile.py. This script should prompt the user for the names of two text files. The contents of the first file should be input and written to the second file.
17. Write a program that inputs a text file. The program should print all of the unique words in the file in alphabetical order.
18. Write a Python class to convert an integer to a roman numeral.
19. Write a Python class to implement pow(x, n)
20. Write a Python class to reverse a string word by word. R16 B.TECH IT WEB SCRIPTING LANGUAGES LAB B.Tech. IV Year I Sem. L T P C Course Code: CS753PC 0 0 3 2
Prerequisites
Any High-level programming language (C, C++)
Course Objectives
To Understand the concepts of scripting languages for developing web-based projects
To understand the applications the of Ruby, TCL, Perl scripting languages
Course Outcomes
Ability to understand the differences between Scripting languages and programming languages
Able to gain some fluency programming in Ruby, Perl, TCL
List of Experiments
1. Write a Ruby script to create a new string which is n copies of a given string where n is a non-negative integer
2. Write a Ruby script which accept the radius of a circle from the user and compute the parameter and area.
3. Write a Ruby script which accept the user's first and last name and print them in reverse order with a space between them
4. Write a Ruby script to accept a filename from the user print the extension of that
5. Write a Ruby script to find the greatest of three numbers
6. Write a Ruby script to print odd numbers from 10 to 1
7. Write a Ruby scirpt to check two integers and return true if one of them is 20 otherwise return their sum
8. Write a Ruby script to check two temperatures and return true if one is less than 0 and the other is greater than 100
9. Write a Ruby script to print the elements of a given array
10. Write a Ruby program to retrieve the total marks where subject name and marks of a student stored in a hash
11. Write a TCL script to find the factorial of a number
12. Write a TCL script that multiplies the numbers from 1 to 10
13. Write a TCL script for Sorting a list using a comparison function
14. Write a TCL script to (i)create a list (ii )append elements to the list (iii)Traverse the list (iv)Concatenate the list
15. Write a TCL script to comparing the file modified times.
16. Write a TCL script to Copy a file and translate to native format.
17. a) Write a Perl script to find the largest number among three numbers.
b) Write a Perl script to print the multiplication tables from 1-10 using subroutines.
18. Write a Perl program to implement the following list of manipulating functions
a) Shift R16 B.TECH IT
b) Unshift
c) Push
19. a) Write a Perl script to substitute a word, with another word in a string.
b) Write a Perl script to validate IP address and email address.
20. Write a Perl script to print the file in reverse order using command line arguments R16 B.TECH IT