python programming questions
1. What is as keyword?
2. Describe python variables.
3. What is the purpose of type() function in python.
4. Explain range() function.
Write a for loop that prints numbers from 0 to 57, using range function.
5. Define Break and continue statement in python.
6. Define the lambda() function for python.
7. Write the difference between Readline( ) amd Readlines( ).
8. What is Tkinter.
9. What is PIP? Write the syntax to install and uninstall python packages.
10. How many types of operators are available in Python. Explain each of them with program.
11. What is slicing in list.
12. Explain in detail about the Lists, Tuples, Sets and Dictionaries with the slicing operations and methods.
13. What do you mean by file handling in python also define its modes.
14. Write a purpose of GUI programming in python. Discuss the following Tkinter geometry methods with syntax:
i) Pack() , ii) Grid(), iii) place() method.
15. Define set and explain operations of set with programming language.
16. Write the difference between Local variable and Global variable in python.
17. Explain the concept of python variables Provide examples to illustrate the declaration and use of variables in Python.
18. What do you understand by Data visualization? Discuss some Python’s data visualization techniques
19. If input:
a = “Hello, World!”
Print(len(a))
Print(“Rahul” in a)
Print(a[2:5])
Print(a[:5])
Print(a[2:])
Print(a.replace(”H”.”J”))
What will be the output?
20. Write a program to sort list of dictionaries by values in python using Lambda function.
21. Write a python program to demonstrate continue, pass and break
22. List=[1,2,3,4,5,6,7,8,9]
Print(Original List:\n“, List)
Print(\n Sliced Lists:“)
Print(List[3:9:2])
Print(List[::2])
Print(List[::])
What will be the output?
23. Write the difference between Tuple, String ,List and Dictionary. Why do we need an array in python programming when we already have a list?
24. Write a function that computes and return addition, subtraction, multiplication, division of two integers. Take input from user
25. Explain the following file built-in function and methods with clear syntax, description and illustration: a) open() , b) file(), c) seek() d)tell()
26. Write the difference between read(), readline() and readlines().
27. Write a Python programming to create a pie chart with a title of programming languages
Sample data: Programming language: python, java, c language, c++, HTML
Popularity: 3.0, 2.0, 2.5, 1.5, 1.0.
28. i) Utilize the matplotlib library to create a simple line plot of a mathematical function.
ii) Use the numpy library to perform basic array operations on two arrays.
29. Create a Tkinter program that consists of a button. When the button is clicked, it should trigger an event to display a message.
30. What is the output of the following code:\
for i in range(3):
for j in range(3):
if i ==j:
break
print(i, j)
31. Describe python variables.
32. List the various python data types with examples.
33. Explain list comprehension.
34. What is the lambda function in python? Explain filter(), map() and reduce() function in brief.
35. Define Tuple data type.
36. Explain read( ) and write( ) method.
37. What is the role of mainloop( ) method.
38. Write a python program to read a CSV file as a dictionary and list.
39. Write a simple python program that draws a line graph where x = [1,2,3,4] and y = [1,4,9,16] and gives both axis label as “X-axis”and “Y-axis”.
40. What is the use of “raise” statement? Describe with an example.
c a={ }
a[‘a’]=1
a[‘b’] =[2,3,4]
print(a)
What will be the output?
31. Explain seek( ) and tell( ) function with example.
32. Differentiate between import library and from library import *.
33. How can you loop through a list in reverse order? Can you use a loop to create a list comprehension?
34. List from highest to lowest precedence with an example for each. Write the steps how python is evaluating the expression and reduce it to a single value :
Solve:- If a=3, b=5, c=10
i) a&b<<2//5**2+c^b
ii) b>>a**2<<2>>b**2^c**3.
35. Discuss:-
i) Boolean Expression.
ii) Bitwise operators.
36. Write a python program to sum of the number in a list.
Sample list: (8,2,3,0,7)
Expected output: 20
37. Write a program to sort list of dictionaries by values in python using Lambda function.
38. Explain bar() function and hist() function with code.
39. Discuss:- i) split() method , ii) strip( ) method, iii) upper() and lower() string method.
40. Write a Python program to count all the vowels in a file.
41. Explain scatter plots with example.
42. What is Data Frames? How to create Data Frames in pandas?
43. Discuss File I/O in python, How to perform open, read, write and close into a file?
44. Explain python libraries with their applications
Comments
Post a Comment