0% found this document useful (0 votes)
13 views20 pages

Practical File

The document lists a series of programming assignments (WAPs) primarily focused on Python and SQL, covering various topics such as mathematical computations, string manipulations, list operations, and database commands. Each assignment includes a brief description of the task, indicating the expected input and output. Additionally, it includes commands for SQL database management, showcasing how to create, modify, and query tables.

Uploaded by

nayannirmalkar20
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views20 pages

Practical File

The document lists a series of programming assignments (WAPs) primarily focused on Python and SQL, covering various topics such as mathematical computations, string manipulations, list operations, and database commands. Each assignment includes a brief description of the task, indicating the expected input and output. Additionally, it includes commands for SQL database management, showcasing how to create, modify, and query tables.

Uploaded by

nayannirmalkar20
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 20

No.

Name of Practical Date Page Sign of the


no. Teacher
1. WAP to compute xn of two given integers x and n.
2. WAP for calculating the simple interest.
3. WAP to accept a number from the user and display whether it is
an even number or an odd number.
4. WAP to accept percentage of a student and display the grade
accordingly.
5. WAP to print the Fibonacci series up to a certain limit.
6. WAP to display prime numbers up to a certain limit.
7. WAP to accept a number, find and display whether it’s an
Armstrong number or not.
8. WAP to accept a number and find out whether it is a perfect
number or not.
9. WAP to print the sum of the exponential series 1+x1/1!+x2/2!+…….
xn/(n)!-
10. WAP to print the following pattern:
1
12
123
11. WAP to accept a string and display whether it is a palindrome.
12. WAP that counts the number of alphabets and digits, upper case
letters, lower case letters, spaces and other characters in the
string entered.
13. WAP to accept a string (a sentence) and return a string with the
first letter of each word in capital letter.
14. WAP to remove all odd numbers from the given list.
15. WAP to display the second largest element of a given list.
16. WAP to display the cumulative elements of a given list.
17. WAP to display the frequencies of all the elements of a list.
18. WAP in Python to display those strings which are starting with
‘A’ in the given list.
19. WAP in Python to find and display the sum of all the values which
are ending with 3 from a list.
20. WAP to shift the positive numbers to the left and the negative
numbers to the right.
21. WAP to swap the content with the next value divisible by 7.
22. WAP to accept values from the user and create a tuple.
23. Write a program to input the total number of sections and stream
names in 11th class and display all information on the output
screen.
24. Write a Python program to input names of ‘n’ countries along
with their capitals and currencies, store them in a dictionary and
display them in a tabular form. Also search for and display a
particular country.
25. Write a program to create an array from range 0 to 9.
26. Write a method to create subsets from a 1D array.
SQL
21 Queries
Program 1: WAP to compute xn of two given integers x and n.
Code:

Output:

Program 2: WAP for calculating the simple interest.


Code:

Output:
Program 3: WAP to accept a number from the user and display whether whether it is an even number or
an odd number.
Code:

Output:

Program 4: WAP to accept percentage of a student and display the grade accordingly.
Code:

Output:
Program 5: WAP to print the Fibonacci series up to a certain limit.
Code:

Output:

Program 6: WAP to display prime numbers up to a certain limit.


Code:

Output:
Program 7: WAP to accept a number, find and display whether it’s an Armstrong number or not.
Code:

Output:

Program 8: WAP to accept a number and find out whether it is a perfect number or not.
Code:

Output:
Program 9: WAP to print the sum of the exponential series 1+x1/1!+x2/2!+…….xn/(n)!-
Code:

Output:

Program 10: WAP to print the following pattern:


1
12
123
Code:

Output:
Program 11: WAP to accept a string and display whether it is a palindrome.
Code:

Output:

Program 12: WAP that counts the number of alphabets and digits, upper case letters, lower case letters,
spaces and other characters in the string entered.
Code:

Output:
Program 13: WAP to accept a string (a sentence) and return a string with the first letter of each word in
capital letter.
Code:

Output:

Program 14: WAP to remove all odd numbers from the given list.
Code:

Output:
Program 15: WAP to display the second largest element of a given list.
Code:

Output:

Program 16: WAP to display the cumulative elements of a given list.


For example, List is [10,20,30,40]
Output should be [10, 30, 60, 100]
Code:

Output:
Program 17: WAP to display the frequencies of all the elements of a list.
Code:

Output:

Program 18: WAP in Python to display those strings which are starting with ‘A’ in the given list.
Code:

Output:
Program 19: WAP in Python to find and display the sum of all the values which are ending with 3 from a list.
Code:

Output:

Program 20: WAP to shift the positive numbers to the left and the negative numbers to the right so that
the resultant list will look like—
Original list: [-12, 11, -13, -5, 6, -7, 5, -3, -6]
Output should be: [11, 6, 5, -6, -3, -7, -5, -13, -12]
Code:

Output:
Program 21: A list Num contains the following elements:
3, 21, 5, 6, 14, 8, 14, 3
WAP to swap the content with the next value divisible by 7 so that the resultant array will look like:
3, 5, 21, 6, 8, 14, 3, 14
Code:

Output:

Program 22: WAP to accept values from the user and create a tuple.
Code:

Output:
Program 23: Write a program to input the total number of sections and stream names in 11th class and
display all information on the output screen.
Code:

Output:

Program 24: Write a Python program to input names of ‘n’ countries along with their capitals and
currencies, store them in a dictionary and display them in a tabular form. Also search for and display a
particular country.
Code:
Output:

Country Capital Currency


Austria Vienna Euro
India New Delhi Indian Rupee
France Paris Euro

Country Capital Currency


India New Delhi Indian Rupee
Program 25: Write a program to create an array from range 0 to 9.
Code:

Output:
Program 26: Write a method to create subsets from a 1D array.
Code:

Output:
1. Command for creating a database.

2. Command for using the database.

3. Command for creating a table.

4. Command for showing the structure of table.

5. Command to show tables present in database.

6. Command for inserting data into a table.

7. Command to view the contents of the table.


8. Command to retrieve data.

9. Command for using the keyword DISTINCT.

10. Command for using the WHERE clause.

11. Command for using the ORDER BY clause.

12. Command for using UPDATE.

13. Command for using ALTER (to modify structure of table).

14. Command for using the LIKE operator.


15. Command for using aggregate functions.

16. Command for adding primary key.

17. Command to delete a column.

18. Command to remove primary key.

19. Command to increase marks.

20. Command to change data type of an existing column.

21. Command to delete a table.

You might also like