The document provides a comprehensive overview of various Python programming concepts, including function definitions, string manipulation, file handling, and object-oriented programming. It includes specific programming tasks such as counting characters and words in a string, calculating areas of different shapes, and using lambda functions. Additionally, it covers topics like variable-length arguments, string methods, programming paradigms, and dictionary operations.
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 ratings0% found this document useful (0 votes)
21 views1 page
PPS QB
The document provides a comprehensive overview of various Python programming concepts, including function definitions, string manipulation, file handling, and object-oriented programming. It includes specific programming tasks such as counting characters and words in a string, calculating areas of different shapes, and using lambda functions. Additionally, it covers topics like variable-length arguments, string methods, programming paradigms, and dictionary operations.
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/ 1
1) Define function with syntax.
Elaborate your answer with an example
Write a program to count the number of characters and words in the given string. 2) s = “Welcome to the world of python programming” (Do not use built-function for the above example) 3) Write a program to find the factorial of a given number. 4) What is Lambda function? Write a program that uses Lambda function to multiply two numbers. 5) Write a Python program to find area of Triangle using function 6) Write a Python program to find area of Rectangle using function 7) Write a Python program to find area of circle using function 8) Write a Python program to find circumference of circle using function Write a short notes on : (Explain with one example) 9) a) Variable length argument b) Default argument 10) Differentiate between ord( ) and chr( ) function. (Explain with one example) Explain following string methods with example. 11) i) 1 strip & r strip ii) Split iii) Zfill Explain the following string operations with suitable example. 12) i) Concatenation ii) Appending iii) String repetition What will be the output of following statement S = “Welcome to Python”. i) print (s[1:9]) ii) print (s[ :6]) 13) iii) print (s[4: ]) iv) print (s[1: –1]) v) Count the number of characters in the given string 14) Why do we need files? Explain relative and absolute path in files. 15) Differentiate between Monolithic and Procedural programming 16) Explain string formatting operators in details. (Any three) 17) Define programming paradigm. List programming paradigms. Explain any three. 18) Explain Membership Operators in Python with example (In and not In operator) Write a python program to create class student to store exam number and marks of four subjects. Use 19) list to store the marks of four subjects. 20) Explain with example Docstring (Documentation String) 21) Explain the concept of a class and an object in OOP. Write syntax for creating class. 22) Explain Public and Private Data Members in a class with an example.. What is a file? Explain different access modes for opening files. 23) Read Write, Append 24) Explain different directory methods with suitable examples. 25) Explain any three methods for reading and writing files. 26) What is a dictionary? How to create, access and modify dictionary elements