0% found this document useful (0 votes)
13 views

Python

Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views

Python

Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

1 a.

Write a program to demonstrate different number datatypes in Python


b. Write a program that takes in the the number of terms and finds the sum of series:
1 + x2/2 + x3/3 + … xn/n.

2 a. Write a program to perform arithmetic operations on numbers


b. Write a program to create, concatenate and print a string and accessing sub- string from
a given string.

3 a.Write a program to add two numbers.


b. write a program to construct the following pattern using nested for loop
*
**
***
****
*****
*****
****
***
**
*

4 a. Write a program to find largest number among three.


b. Write a program to print prime numbers less than 20.

5 a. Write a program to find the given number is even or odd.


b.Write a program to find factorial of a number using recursion.

6 a. Write a python program to print a number is positive/negative using if-else.


b.Write a program to define a module to find fibonaaci numbers and import the
module to another program.

7 a.Write a program to find sum of individual digits.


b.Create a list and perform the following methods
1) insert( ) 2) remove( ) 3) append( ) 4) len( )

8 a. Write a program to check the given string is palindrome or not.


b.Write a program to find the cumulative sum of a list where the ith element is the
sum of the first i+1 elements from the original list.

9 a. Write a program to find GCD of two numbers.


b. Create a dictionary and apply the following methods
1) Print the dictionary items 2) access items 3) useget()
4)change values 5) use len()

10 a. Use a for loop to print a triangle like the one below. Allow the user to specify how high
the triangle should be
*
**
***
****

b. Write a program to count the frequency of words appearing in a string using a dictionary
11.a. Write a program to perform arithmetic operations on numbers
b. Write a program to count the number of vowels present in a string using sets

12.a. Write a program to add two numbers.


b. Write a program which accepts the radius of circle from user and compute area (use
math module).

13.a. Write a program to find largest number among three.


b.write a program to construct the following pattern using nested for loop
*
**
***
****
*****
*****
****
***
**
*

14.a. Write a program to find the given number is even or odd.


b.Create a tuple and perform the following methods
1) Add items 2) len() 3) check for item in tuple 4)Access iems

15.a. Write a python program to print a number is positive/negative using if-else.

b. Write a program to find the area of a rectangle using classes.

You might also like