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

Python Imp 20

The document outlines various aspects of Python programming, including features, comment syntax, and applications. It discusses methods for removing key-value pairs from dictionaries, the use of Pass and Else keywords in loops, and built-in functions for tuples and lists. Additionally, it covers operators, data structures, and provides programming tasks related to sets, strings, and mathematical operations.

Uploaded by

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

Python Imp 20

The document outlines various aspects of Python programming, including features, comment syntax, and applications. It discusses methods for removing key-value pairs from dictionaries, the use of Pass and Else keywords in loops, and built-in functions for tuples and lists. Additionally, it covers operators, data structures, and provides programming tasks related to sets, strings, and mathematical operations.

Uploaded by

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

1.

List features of Python

2. How to give single and multiline comment in python.

3.Write python program to display output like.

2
468
10 2 14 16 18
4.Enlist applications for python programming

5. List comparison operators in Python


6. Describe membership operators in python.

7. Explain different functions or ways to remove key : value pair from Dictionary

In Python, you can remove a key-value pair from a dictionary using different methods:
1.Using pop(key)
o Removes the key and returns its value.

2.Using del statement

• Deletes the key-value pair directly.

• If the key is not found, it raises a KeyError.


8. Explain use of Pass and Else keyword with for loops in python.
9. Show the output for the following
10. Explain four Buit-in tuple functions in python with example
11. Explain mutable and immutable data structures
12. What is the output of the following program?
dict1 = {‘Google’ : 1, ‘Facebook’ : 2, ‘Microsoft’ : 3}
dict2 = {‘GFG’ : 1, ‘Microsoft’ : 2, ‘Youtube’ : 3}
dict1⋅update(dict2);
for key, values in dictl⋅items( ):
print (key, values)
13. Difference between list and tuple
14. Mention the use of //, **, % operator in Python
15 Write python program to perform following operations on set. i) Create set of five
elements ii) Access set elements iii) Update set by adding one element iv) Remove
one element from set.
16.List identity operators in python.
17.Explain four built-in list functions
18. Write the output for the following if the variable course = “Python”
>>> course [ : 3 ]
>>> course [ 3 : ]
>>> course [ 2 : 2 ]
>>> course [ : ]
>>> course [ -1 ]

>>> course [ 1]
19. Write a python program takes in a number and find the sum of digits in a number.
20 .Write a Python program to find the factorial of a number provided by the user

You might also like