Kit Library

🎯 Exam Preparation Kit

Python Scripting Exam Prep

English 67 leveled MCQs Free

Shared by a Veda learner · Generated with Veda AI

Smart notes

What you'll study, topic by topic

1

Python Scripting Exam Prep

Full explanation, worked examples & memory tricks in the app

Solved paper preview

Sample questions with model answers

Every question in the paper gets a full exam-length answer in the app — organised by marks, the way a topper writes it.

7 marks Long answer

List out different types of Data types in Python and Explain each one with example.

Show answer outline

Data types include int, float, str, list, tuple, dict, set, each serving different purposes.

The full exam-length answer is in the app.

7 marks Long answer

Explain Input and Output statements in Python by giving examples.

Show answer outline

Input statements take user input, while output statements display data.

The full exam-length answer is in the app.

7 marks Long answer

Explain type casting with example.

Show answer outline

Type casting converts one data type to another, e.g., int('5') converts string to integer.

The full exam-length answer is in the app.

7 marks Long answer

Explain membership and identity operators with examples.

Show answer outline

'in' checks membership, 'is' checks identity; e.g., 5 in [1, 2, 3, 5].

The full exam-length answer is in the app.

7 marks Long answer

Develop a program that picks a random integer from 1 to 100, and has players guess the number.

Show answer outline

Use random.randint(1, 100) for the number and implement guessing logic.

The full exam-length answer is in the app.

7 marks Long answer

Develop a program that displays an ASCII character table from ! to ~.

Show answer outline

Use a loop and chr() to display characters and their ASCII values.

The full exam-length answer is in the app.

7 marks Long answer

Develop a program that counts the occurrences of each digit in a string.

Show answer outline

Use a dictionary to count digits in the input string.

The full exam-length answer is in the app.

7 marks Long answer

Develop a program to repeatedly prompt the user to enter the capital of a state.

Show answer outline

Use a loop to check user input against a dictionary of states and capitals.

The full exam-length answer is in the app.

7 marks Long answer

Develop a program to print the dates of all the Sundays in a given year.

Show answer outline

Use datetime module to find and print all Sundays of the year.

The full exam-length answer is in the app.

7 marks Long answer

Create a user defined module with simple functions for: addition, subtraction, multiplication, division, modulo, square, factorial.

Show answer outline

Define functions in a .py file and import it to use.

The full exam-length answer is in the app.

7 marks Long answer

Develop an automated censor program that reads the text from a file and creates a new file where all of the four-letter words have been replaced by “****”.

Show answer outline

Read file, replace words, and write to a new file.

The full exam-length answer is in the app.

7 marks Long answer

Develop a program that reads a text file and calculates the average word length and sentence length in that file.

Show answer outline

The program reads a file, counts words and sentences, then calculates averages.

The full exam-length answer is in the app.

7 marks Long answer

Write a Python program to check whether a given string is palindrome or not.

Show answer outline

A palindrome check can be done by comparing the string to its reverse.

The full exam-length answer is in the app.

7 marks Long answer

Write a program to display the Fibonacci sequences up to n^{th} term where n is provided by the user.

Show answer outline

Use a loop to generate Fibonacci numbers until the n^{th} term.

The full exam-length answer is in the app.

7 marks Long answer

Write a program to check palindrome number.(example- 13231-palindrome 1201-not palindrome)

Show answer outline

Check if the string is equal to its reverse.

The full exam-length answer is in the app.

7 marks Long answer

Given a two list of numbers, write a program to create a new list such that the new list should contain even numbers from the first list and odd numbers from the second list. L1=[12,15,30,42,35] L2=[34,23,77,50,32] Expected output: Result list=[12,30,42,23,77]

Show answer outline

Filter even from L1 and odd from L2, then combine.

The full exam-length answer is in the app.

7 marks Long answer

Write a program to define module to find sum of two numbers. Import module to another program.

Show answer outline

Define a function in a module and use import to access it.

The full exam-length answer is in the app.

7 marks Long answer

List testing functions in string. Explain any five testing functions with example.

Show answer outline

Functions include isalpha(), isdigit(), isalnum(), isspace(), and istitle().

The full exam-length answer is in the app.

7 marks Long answer

List file modes with their description(any seven modes).

Show answer outline

Modes include 'r', 'w', 'a', 'r+', 'w+', 'a+', 'x'.

The full exam-length answer is in the app.

7 marks Long answer

List out arithmetic operations. Build python code that performs three arithmetic operations.

Show answer outline

Arithmetic operations include addition, subtraction, multiplication; code example demonstrates these operations.

The full exam-length answer is in the app.

7 marks Long answer

Create a Python program to display the following patterns using loop concept. * * * * *

Show answer outline

The program uses nested loops to print the star pattern.

The full exam-length answer is in the app.

7 marks Long answer

Write a Python program to perform the below operations on the list: Read n numbers from a user, Find positive numbers, Find negative numbers.

Show answer outline

The program reads numbers, filters positive and negative ones.

The full exam-length answer is in the app.

7 marks Long answer

Create a user-defined module with a simple functions for finding the area of a square, circle and rectangle. Write a program to import the module and access functions defined in the module.

Show answer outline

The module contains area functions; program imports and uses these functions.

The full exam-length answer is in the app.

7 marks Long answer

Write a Python program that reads a text file and counts the occurrences of each alphabet in the file. The program should prompt the user to enter the filename.

Show answer outline

The program reads a file and counts letter occurrences, prompting for filename.

The full exam-length answer is in the app.

5 marks Long answer

Explain how to create Dictionary in Python. Write a Python program to concatenate two dictionaries into a new one.

Show answer outline

Dictionaries are created using {} or dict(); program shows concatenation.

The full exam-length answer is in the app.

4 marks Medium answer

Write output of following. 1. print(6-10/2+1) 2. if n=4, what is n**3? 3. print(5.5//2) 4. print(5.5/2)

Show answer outline

Outputs: 3.0, 64, 2.0, 2.75

The full exam-length answer is in the app.

4 marks Medium answer

Explain usage of given string methods i) swapcase() ii) replace() iii) rstrip() iv) upper()

Show answer outline

swapcase() toggles case, replace() substitutes substrings, rstrip() removes trailing whitespace, and upper() converts to uppercase.

The full exam-length answer is in the app.

4 marks Medium answer

Explain usage of given string methods in Python. ▪ islower ( ) ▪ isupper ( ) ▪ isdigit ( ) ▪ isalnum ()

Show answer outline

The methods islower(), isupper(), isdigit(), and isalnum() are used to check the case and type of characters in a string.

The full exam-length answer is in the app.

4 marks Medium answer

Explain in detail about control flow structures in python.

Show answer outline

Control flow structures include if, for, while, allowing conditional and iterative execution.

The full exam-length answer is in the app.

4 marks Medium answer

Write the syntax and usage of for loop.

Show answer outline

for variable in iterable: # code block

The full exam-length answer is in the app.

4 marks Medium answer

List built-in Dictionary functions with description.

Show answer outline

Functions include keys(), values(), items(), get(), and pop().

The full exam-length answer is in the app.

4 marks Medium answer

Differentiate between a package and a module in python.

Show answer outline

A module is a single file, while a package is a collection of modules.

The full exam-length answer is in the app.

4 marks Medium answer

Differentiate between text file and binary file.

Show answer outline

Text files store data in human-readable format, while binary files store data in a format readable by the machine.

The full exam-length answer is in the app.

4 marks Medium answer

Write a program to reverse string.

Show answer outline

Use slicing or a loop to reverse the string.

The full exam-length answer is in the app.

4 marks Medium answer

Define selection statement. Explain any one in detail.

Show answer outline

A selection statement executes code based on conditions; e.g., if-else.

The full exam-length answer is in the app.

4 marks Medium answer

Describe range function with example.

Show answer outline

Range generates a sequence; e.g., range(5) produces [0, 1, 2, 3, 4].

The full exam-length answer is in the app.

4 marks Medium answer

Explain methods of python list with example.

Show answer outline

List methods include append(), remove(), and sort(); e.g., myList.append(5).

The full exam-length answer is in the app.

4 marks Medium answer

Explain operation of Set in Python by giving example.

Show answer outline

Sets are unordered collections; e.g., set([1, 2, 3]) creates a set.

The full exam-length answer is in the app.

4 marks Medium answer

What is package? How to Create and import package. Explain with example.

Show answer outline

A package is a collection of modules; use __init__.py to create one.

The full exam-length answer is in the app.

4 marks Medium answer

List out types of plots in Matplotlib. Explain any one with example.

Show answer outline

Types include line, bar, scatter; e.g., plt.plot(x, y) for line plot.

The full exam-length answer is in the app.

4 marks Medium answer

Explain usage of given string methods i) startswith() ii) find() iii) count() iv) index().

Show answer outline

startswith() checks prefix; find() locates substring; count() counts occurrences; index() finds position.

The full exam-length answer is in the app.

4 marks Medium answer

Explain while loop with a suitable example.

Show answer outline

while loop continues until a condition is false; example demonstrates its use.

The full exam-length answer is in the app.

4 marks Medium answer

Explain a random module of Python with a suitable example.

Show answer outline

The random module generates random numbers; example shows its usage.

The full exam-length answer is in the app.

4 marks Medium answer

Explain to access string elements using index operator with a suitable example.

Show answer outline

Index operator [] accesses elements by position; example shows its use.

The full exam-length answer is in the app.

3 marks Medium answer

Explain the usage of given file handling methods in Python. ▪ read ( ) ▪ readline ( ) ▪ readlines ( )

Show answer outline

The methods read(), readline(), and readlines() are used to read data from files in Python.

The full exam-length answer is in the app.

3 marks Medium answer

Explain read(), readline() and readlines() for file with example.

Show answer outline

read() reads the entire file, readline() reads one line, and readlines() reads all lines into a list.

The full exam-length answer is in the app.

3 marks Medium answer

Explain for loop with example.

Show answer outline

A for loop iterates over a sequence; e.g., for i in range(5): print(i).

The full exam-length answer is in the app.

3 marks Medium answer

Explain break, continue, and pass statement with suitable example.

Show answer outline

Break exits a loop, continue skips to the next iteration; pass does nothing.

The full exam-length answer is in the app.

3 marks Medium answer

Write down the properties of dictionary in python.

Show answer outline

Dictionaries are unordered, mutable, and indexed by keys.

The full exam-length answer is in the app.

3 marks Medium answer

Write the difference between Tuple and List in python.

Show answer outline

Tuples are immutable; lists are mutable.

The full exam-length answer is in the app.

3 marks Medium answer

Define function. Why do we need it?

Show answer outline

A function is a reusable code block; it promotes code modularity.

The full exam-length answer is in the app.

3 marks Medium answer

What is Recursion? Explain with example.

Show answer outline

Recursion is a function calling itself; e.g., factorial(n) = n * factorial(n-1).

The full exam-length answer is in the app.

3 marks Medium answer

Explain write(), append() and writelines () for file with example.

Show answer outline

write() overwrites, append() adds, writelines() writes multiple lines.

The full exam-length answer is in the app.

3 marks Medium answer

List out features and application of python.

Show answer outline

Features include simplicity, readability, and extensive libraries; applications range from web development to data science.

The full exam-length answer is in the app.

3 marks Medium answer

Explain if and if-else statement with a suitable example.

Show answer outline

if checks a condition; if-else provides an alternative path.

The full exam-length answer is in the app.

3 marks Medium answer

Explain how to create a Set in Python by giving example.

Show answer outline

A Set is created using set() or curly braces; example shows its creation.

The full exam-length answer is in the app.

3 marks Medium answer

Explain file handling basic Python function to open and close the text file.

Show answer outline

open() opens a file, close() closes it; example demonstrates both.

The full exam-length answer is in the app.

2 marks Short answer

Define Identifier. State rules of identifier.

Show answer outline

An identifier is a name used to identify a variable, function, class, module, or other object.

The full exam-length answer is in the app.

2 marks Short answer

What is break statement and continue statement in python?

Show answer outline

break terminates the loop, while continue skips the current iteration.

The full exam-length answer is in the app.

2 marks Short answer

Explain syntax of following statements. - If else - If elif else

Show answer outline

if condition: # code else: # code for else.

The full exam-length answer is in the app.

Study it properly — free, in the app

The full Veda Bites deck, complete notes, spaced-repetition flashcards, leveled MCQs, tests and games for this kit — plus Daily Facts and the Arena, every day.