You are on page 1of 31

Computer Programming

FCCS0102
PRACTICAL RECORD FILE
2023-24

Submitted by: Submitted to:


Name: Mohit Soni Vidhu Jain
Roll No: 2023UEA6655
Branch: ECAM
Section: 2

Netaji Subhas University of Technology


Q1. Write a Python program to add two numbers.

Output -

Q2. Write a program in python to swap two variables.

Output -
Q3. Write a program in python to multiply two matrices.

Output -
Q4. Write a Python program to make a simple calculator.

OUPTUT -
Q5. Write a program in python to print a Fibonacci series.

OUTPUT -

Q6. Write a program in python to find largest of three numbers.

OUPUT -
Q7. Write a program in python to create a function that can accept two
arguments name and age and print its value.

OUTPUT -

Q8. Write a program in python to create function func1() such that it


can accept a variable length of argument and print all the arguments
value.

OUTPUT -
Q9. Write a program in python to calculate the sum of numbers from 0
to 10.

OUTPUT -

Q10. Write a program in python to assign a different name to a


function and call it by a new name.

OUPUT -
Q11. Write a program in python to generate a list of all even numbers
between 4 to 30.

OUPUT -

Q12. Write a program in python to return the largest item from the
given list.

OUTPUT -
Q13. Write a program in python to add a key to dictionary.

OUTPUT -
Exercise problems on loops

Q1. Write a program in python to display the first ten natural numbers

OUTPUT -

Q2. Write a program in python to find the sum of first ten natural
numbers.

OUTPUT -
Q3. Write a program in python to display n terms of natural number
and their sum.

OUTPUT -

Q4. Write a program in python to read 10 numbers from keyboard and


find their sum and average.

OUTPUT -
Q5. Write a program in python to display the cube of the number upto
given integer.

OUTPUT -

Q6. Write a program in python to display the multiplication table of a


given integer.

OUTPUT -
Q7. Write a program in python to display the n terms of odd natural
numbers and their sum.

OUTPUT -

Q8. Write a program in python to display the pattern like right angle
triangle using an asterisk.

OUTPUT -
Q9. Write a program in python to display the pattern like right angle
triangle with a number.

OUTPUT -

Q10. Write a program in python to display the pattern like right angle
triangle with a number which will repeat in a row.

OUTPUT -
Q11. Write a program in Python to make such a pattern like right angle
triangle with a number increased by 1.

OUTPUT -

Q12. Write a program in python to make such a pattern like pyramid


with a number increased by 1.

OUTPUT -
Q13. Write a program in python to make such a pattern like pyramid
with an asterisk.

OUTPUT -

Q14. Write a program in Python to calculate the factorial of a given


number.

OUTPUT -
Q15. Write a program in Python to display the n terms of even
numbers and their sum.

OUTPUT -

Q16. Write a program in python to find the sum of the series [1-x^2/2!
+ x^4/4! ...... ].

OUTPUT -
Q17. Write a program in python to display the n terms of harmonic
series and their sum
1 + 1/2 + 1/3 + 1/4 +.... 1/n terms

OUTPUT -

Q18. Write a python program to append a list to second list.

OUTPUT -
Q19. Write a python program to check whether two lists are circularly
identical.

OUTPUT -

Q20. Write a python program to find the second smallest number in


the list.

OUTPUT -
Q21. Write a python program to find the second largest number in the
list.

OUTPUT -

Q22. Write a python program to get unique values from a list.

OUTPUT -
Q23. Write a python program to get the frequency of the elements in a
list.

OUTPUT -
Exercise problems on tuples

Q1. Write a python program to create a tuple.

OUTPUT -

Q2. Write a python program to create a tuple with numbers and print
one item.

OUTPUT -
Q3. Write a python program to add an item in a tuple.

OUTPUT -

Q4. Write a python program to get the 4th element and 4th element
from last of a tuple.

OUTPUT -
Q5. Write a python program to find the repeated items of a tuple.

OUTPUT -

Q6. Write a python program to check whether an element exists within


a tuple.

OUTPUT -

Q7. Write a python program to convert a list into a tuple.

OUTPUT -
Q8. Write a python program to remove an item from a tuple.

OUTPUT -

Q9. Write a python program to slice an item in a tuple.

OUTPUT -

Q10. Write a python program to find the index of an item of a tuple.

OUTPUT -
Q11. Write a python program to find the length of a tuple.

OUTPUT -

Q12. Write a python program to reverse a tuple.

OUTPUT -

Q13. Write a python program to replace last value of a tuple in a list.

OUTPUT -
Q14. Write a Python program to remove an empty tuple(s) from the list
of tuples.

OUTPUT –

Q15. Write a Python program to sort a tuple by its float element.

OUTPUT -

Q16. Write a Python program to convert a given string list into a tuple.

OUTPUT -
Q17. Write a Python program to calculate the product, multiplying all
the numbers of a given tuple.

OUTPUT -

Q18. Write a python program to calculate the average value of the


numbers in a given tuple of tuples.

OUTPUT -
Q19. Write a python program to check if a specified element present in
a tuple.

OUTPUT -

Q20. Write a python program to convert a tuple into a string

OUTPUT -

You might also like