100+ CBSE Class 12 Informatics Practices Viva Questions and Answers 2025-26

Introduction
This comprehensive guide contains 100+ essential viva questions for CBSE Class 12 Informatics Practices (Code 065) board exam 2025-26. These questions cover all major topics including Python, Pandas, Data Visualization, SQL, and Societal Impact.
Section 1: Python Programming Basics (Questions 1-15)
Q1. What is Python? Why is it popular for data science?
Answer: Python is a high-level, interpreted programming language known for its simple syntax and readability. It’s popular for data science because of powerful libraries like NumPy, Pandas, Matplotlib, and extensive community support for data analysis tasks.
Q2. What are the different data types in Python?
Answer: The main data types are: int (integers), float (decimal numbers), str (strings), bool (True/False), list (ordered mutable collection), tuple (ordered immutable collection), dict (key-value pairs), and set (unordered unique elements).
Q3. What is the difference between a list and a tuple?
Answer: Lists are mutable (can be changed after creation) and use square brackets [], while tuples are immutable (cannot be changed) and use parentheses (). Lists are slower but flexible; tuples are faster and used for fixed data.
Q4. What is a dictionary in Python?
Answer: A dictionary is an unordered collection of key-value pairs enclosed in curly braces {}. Keys must be unique and immutable, while values can be any data type. Example: student = {'name': 'Raj', 'age': 17}
Q5. Explain the difference between ‘==’ and ‘is’ operators.
Answer: ‘==’ checks if values are equal, while ‘is’ checks if two variables point to the same object in memory. Example: a = [1,2] and b = [1,2] will have a == b as True but a is b as False.
Q6. What are Python libraries? Name some important ones.
Answer: Libraries are collections of pre-written code modules. Important ones for IP include: Pandas (data manipulation), NumPy (numerical computing), Matplotlib (plotting), Seaborn (statistical visualization), and MySQL Connector (database connectivity).
Q7. What is the difference between a function and a method?
Answer: A function is independent and called by its name (e.g., print()), while a method is associated with an object and called using dot notation (e.g., list.append()). Methods are functions that belong to a class.
Q8. What are arguments and parameters in functions?
Answer: Parameters are variables listed in the function definition, while arguments are actual values passed to the function when calling it. Example: In def add(a, b):, a and b are parameters. In add(5, 3), 5 and 3 are arguments.
Q9. What is the difference between local and global variables?
Answer: Local variables are declared inside a function and can only be accessed within that function. Global variables are declared outside functions and can be accessed throughout the program. Use global keyword to modify global variables inside functions.
Q10. What are Python modules? How do you import them?
Answer: Modules are Python files containing functions, classes, and variables. Import using: import module_name, from module_name import function_name, or import module_name as alias. Example: import pandas as pd
Q11. What is the purpose of the if name == “main” statement?
Answer: This statement checks if the Python file is being run directly or being imported as a module. Code under this condition only executes when the file is run directly, not when imported.
Q12. What are escape sequences in Python?
Answer: Escape sequences are special characters preceded by backslash (). Common ones: \n (newline), \t (tab), \ (backslash), ‘ (single quote), ” (double quote). Example: print("Hello\nWorld") prints on two lines.
Q13. What is string slicing?
Answer: String slicing extracts portions of a string using indices. Syntax: string[start:end:step]. Example: "Python"[0:4] returns “Pyth”. Negative indices count from the end. "Python"[-3:] returns “hon”.
Q14. What are list comprehensions?
Answer: List comprehensions provide a concise way to create lists. Syntax: [expression for item in iterable if condition]. Example: squares = [x**2 for x in range(10)] creates a list of squares from 0 to 81.
Q15. What is exception handling? Why is it important?
Answer: Exception handling manages runtime errors using try-except blocks, preventing program crashes. Syntax: try: risky_code except ErrorType: handle_error. It’s important for creating robust programs that handle unexpected situations gracefully.
Section 2: NumPy Fundamentals (Questions 16-25)
Q16. What is NumPy? Why is it used?
Answer: NumPy (Numerical Python) is a library for numerical computing, providing support for arrays, matrices, and mathematical functions. It’s faster than Python lists for numerical operations and is the foundation for Pandas and other scientific libraries.
Q17. What is a NumPy array? How is it different from a Python list?
Answer: A NumPy array is a grid of homogeneous data. Unlike lists, arrays must contain elements of the same data type, are memory-efficient, support vectorized operations, and enable faster mathematical computations.
Q18. How do you create a NumPy array?
Answer: Common methods: np.array([1,2,3]) from list, np.zeros(5) for zeros, np.ones((3,3)) for ones, np.arange(0,10,2) for sequences, np.linspace(0,1,5) for evenly spaced values, np.random.rand(3,3) for random values.
Q19. What is array indexing and slicing in NumPy?
Answer: Indexing accesses specific elements using indices: arr[0] for first element. Slicing extracts portions: arr[1:4] for elements 1-3. For 2D arrays: arr[row, col] or arr[row1:row2, col1:col2].
Q20. What are NumPy array operations?
Answer: Arrays support element-wise operations: addition (+), subtraction (-), multiplication (*), division (/), power (**). Also aggregate functions: sum(), mean(), max(), min(), std(). Example: arr1 + arr2 adds corresponding elements.
Q21. What is broadcasting in NumPy?
Answer: Broadcasting allows operations on arrays of different shapes by automatically expanding smaller arrays. Example: adding a scalar to an array or adding a 1D array to each row of a 2D array without explicit loops.
Q22. What are some common NumPy mathematical functions?
Answer: np.sqrt() (square root), np.exp() (exponential), np.log() (logarithm), np.sin(), np.cos(), np.abs() (absolute value), np.round() (rounding), np.floor(), np.ceil().
Q23. How do you reshape NumPy arrays?
Answer: Use reshape() method: arr.reshape(rows, cols). Example: arr.reshape(3,4) converts array to 3 rows and 4 columns. Use -1 for automatic dimension: arr.reshape(-1,2) auto-calculates rows.
Q24. What is the difference between np.zeros() and np.empty()?
Answer: np.zeros() creates an array filled with zeros, while np.empty() creates an array without initializing values (contains random data). np.empty() is faster but should be used only when you’ll immediately fill the array.
Q25. What are axis parameters in NumPy operations?
Answer: axis=0 operates along columns (vertically), axis=1 operates along rows (horizontally). Example: arr.sum(axis=0) sums each column, arr.sum(axis=1) sums each row. No axis parameter operates on entire array.
Section 3: Pandas Series (Questions 26-40)
Q26. What is Pandas? Why is it important?
Answer: Pandas is a Python library for data manipulation and analysis. It provides DataFrame and Series structures for handling structured data efficiently. It’s essential for data cleaning, transformation, analysis, and is widely used in data science.
Q27. What is a Pandas Series?
Answer: A Series is a one-dimensional labeled array that can hold any data type. It has an index (labels) and values. Example: s = pd.Series([10,20,30], index=['a','b','c']).
Q28. How do you create a Pandas Series?
Answer: Methods: pd.Series([1,2,3]) from list, pd.Series({'a':1, 'b':2}) from dictionary, pd.Series(10, index=[0,1,2]) with scalar, pd.Series(np_array) from NumPy array.
Q29. What is the difference between Series and NumPy array?
Answer: Series has labeled indices while NumPy arrays use integer positions. Series can hold mixed data types in indices, supports more operations like alignment by label, and has better integration with DataFrames.
Q30. How do you access elements in a Series?
Answer: Using index labels: s['a'] or s.loc['a'], using integer position: s[0] or s.iloc[0], slicing: s['a':'c'] or s[0:2], boolean indexing: s[s > 10].
Q31. What are some common Series attributes?
Answer: s.index (index labels), s.values (array of values), s.dtype (data type), s.shape (dimensions), s.size (number of elements), s.name (series name), s.ndim (number of dimensions).
Q32. Explain Series methods: head() and tail().
Answer: head(n) returns first n elements (default 5), useful for previewing data. tail(n) returns last n elements. Example: s.head(3) shows first 3 elements, s.tail() shows last 5.
Q33. What are Series mathematical operations?
Answer: Supports arithmetic: s + 10, s * 2, s ** 2. Aggregate functions: s.sum(), s.mean(), s.median(), s.std(), s.min(), s.max(). Element-wise: s.abs(), s.round().
Q34. How do you handle missing values in Series?
Answer: Detect: s.isnull(), s.notnull(). Count: s.isnull().sum(). Remove: s.dropna(). Fill: s.fillna(value) or s.fillna(method='ffill') for forward fill, s.fillna(method='bfill') for backward fill.
Q35. What is the difference between loc and iloc?
Answer: loc uses label-based indexing (uses index names), while iloc uses integer-based indexing (uses positions). Example: s.loc['a'] vs s.iloc[0]. loc includes end point in slices, iloc doesn’t.
Q36. How do you sort a Series?
Answer: Sort by values: s.sort_values(ascending=True) or s.sort_values(ascending=False). Sort by index: s.sort_index(). Use inplace=True to modify original series or assign to new variable.
Q37. What are Series string methods?
Answer: Accessed via .str: s.str.lower(), s.str.upper(), s.str.strip(), s.str.replace('old','new'), s.str.contains('pattern'), s.str.split(), s.str.len(). Work only on string Series.
Q38. How do you create a Series with custom index?
Answer: Pass index parameter: s = pd.Series([10,20,30], index=['x','y','z']) or s = pd.Series(data_dict) where dictionary keys become index. Can also use s.index = new_index to reassign.
Q39. What is Series value_counts() method?
Answer: Returns frequency count of unique values in descending order. Example: s.value_counts() shows how many times each value appears. Use normalize=True for proportions, dropna=False to include NaN.
Q40. How do you apply functions to Series?
Answer: Use apply() method: s.apply(function_name) or s.apply(lambda x: x*2). Also map() for element-wise mapping with dictionary: s.map({old_val: new_val}).
Section 4: Pandas DataFrame (Questions 41-60)
Q41. What is a Pandas DataFrame?
Answer: A DataFrame is a 2-dimensional labeled data structure with columns of potentially different types, similar to a spreadsheet or SQL table. It has row indices and column names, making data manipulation intuitive.
Q42. How do you create a DataFrame?
Answer: From dictionary: pd.DataFrame({'col1':[1,2], 'col2':[3,4]}), from list of lists: pd.DataFrame([[1,2],[3,4]], columns=['A','B']), from CSV: pd.read_csv('file.csv'), from dictionary of Series.
Q43. What are common DataFrame attributes?
Answer: df.shape (rows, columns), df.columns (column names), df.index (row labels), df.dtypes (data types), df.size (total elements), df.ndim (dimensions-always 2), df.values (NumPy array).
Q44. How do you view DataFrame contents?
Answer: df.head(n) (first n rows), df.tail(n) (last n rows), df.info() (structure info), df.describe() (statistical summary), df.sample(n) (random n rows), simple df displays entire DataFrame.
Q45. How do you select columns from a DataFrame?
Answer: Single column: df['col_name'] returns Series or df.col_name. Multiple columns: df[['col1','col2']] returns DataFrame. Must use bracket notation for names with spaces.
Q46. How do you select rows from a DataFrame?
Answer: By position: df.iloc[0] (first row), df.iloc[0:3] (first 3 rows). By label: df.loc['label']. Boolean indexing: df[df['Age'] > 18]. Multiple conditions: df[(df['Age']>18) & (df['City']=='Delhi')].
Q47. How do you add new columns to a DataFrame?
Answer: Direct assignment: df['new_col'] = values, from calculation: df['total'] = df['col1'] + df['col2'], from function: df['category'] = df['score'].apply(lambda x: 'Pass' if x>40 else 'Fail').
Q48. How do you delete columns or rows?
Answer: Delete columns: df.drop(['col1','col2'], axis=1) or del df['col']. Delete rows: df.drop([0,1,2], axis=0) or df.drop(index=['label']). Use inplace=True to modify original.
Q49. What is the difference between drop() and del?
Answer: drop() is more flexible, can drop multiple items, works on rows/columns, and can use inplace parameter. del only works on single columns, immediately modifies DataFrame, and is simpler but less versatile.
Q50. How do you handle missing values in DataFrame?
Answer: Detect: df.isnull(), df.notnull(). Count: df.isnull().sum(). Remove: df.dropna() (remove rows), df.dropna(axis=1) (remove columns). Fill: df.fillna(value), df.fillna(method='ffill'), df.fillna(df.mean()).
Q51. How do you rename columns in DataFrame?
Answer: df.rename(columns={'old_name':'new_name'}) for specific columns or df.columns = ['new1','new2','new3'] for all columns. Use inplace=True to modify original DataFrame.
Q52. What is DataFrame groupby() operation?
Answer: Groups data by one or more columns and applies aggregate functions. Syntax: df.groupby('column').aggregate_function(). Example: df.groupby('City')['Sales'].sum() sums sales by city. Can group by multiple columns.
Q53. How do you sort a DataFrame?
Answer: By values: df.sort_values(by='column') or df.sort_values(by=['col1','col2']) for multiple columns. By index: df.sort_index(). Parameters: ascending=False for descending, inplace=True to modify original.
Q54. What are DataFrame merge and join operations?
Answer: Merge combines DataFrames on common columns: pd.merge(df1, df2, on='key'). Types: inner (default), left, right, outer. Join combines on indices: df1.join(df2). Concat stacks DataFrames: pd.concat([df1,df2]).
Q55. How do you read CSV files in Pandas?
Answer: df = pd.read_csv('filename.csv'). Common parameters: sep=',' (delimiter), header=0 (header row), index_col=0 (index column), usecols=['col1','col2'] (specific columns), nrows=100 (limit rows).
Q56. How do you write DataFrame to CSV?
Answer: df.to_csv('filename.csv'). Parameters: index=False (exclude index), header=True (include headers), sep=',' (delimiter), columns=['col1','col2'] (specific columns), mode='a' (append mode).
Q57. What is the difference between apply() and applymap()?
Answer: apply() works on Series/DataFrame along axis (row or column-wise): df.apply(func, axis=0). applymap() works element-wise on entire DataFrame: df.applymap(func). For single column, use df['col'].map().
Q58. How do you filter DataFrame with multiple conditions?
Answer: Use logical operators with parentheses: df[(df['Age']>18) & (df['Marks']>40)] (AND), df[(df['City']=='Delhi') | (df['City']=='Mumbai')] (OR), df[~(df['Status']=='Failed')] (NOT). Each condition needs parentheses.
Q59. What are DataFrame aggregate functions?
Answer: df.sum(), df.mean(), df.median(), df.mode(), df.std(), df.var(), df.min(), df.max(), df.count(), df.quantile(). Use axis=0 for column-wise (default), axis=1 for row-wise.
Q60. How do you pivot a DataFrame?
Answer: df.pivot(index='col1', columns='col2', values='col3') reshapes data. df.pivot_table() adds aggregation: df.pivot_table(values='Sales', index='Month', columns='Product', aggfunc='sum'). Useful for cross-tabulation and summary tables.
Section 5: Data Visualization (Questions 61-75)
Q61. What is data visualization? Why is it important?
Answer: Data visualization is graphical representation of data using charts, graphs, and plots. It’s important because it makes complex data easier to understand, reveals patterns and trends, aids decision-making, and communicates insights effectively.
Q62. What is Matplotlib? What is pyplot?
Answer: Matplotlib is a comprehensive Python library for creating static, animated, and interactive visualizations. pyplot is a module within Matplotlib that provides a MATLAB-like interface, making it easy to create plots with simple commands.
Q63. How do you create a simple line plot?
Answer:
import matplotlib.pyplot as plt
plt.plot([1,2,3,4], [10,20,25,30])
plt.xlabel('X-axis')
plt.ylabel('Y-axis')
plt.title('Line Plot')
plt.show()
Q64. What are the different types of plots in Matplotlib?
Answer: Line plot (plot()), Bar chart (bar()), Histogram (hist()), Scatter plot (scatter()), Pie chart (pie()), Box plot (boxplot()), Area plot (fill_between()), Stem plot (stem()).
Q65. How do you create a bar chart?
Answer:
categories = ['A','B','C']
values = [10,25,15]
plt.bar(categories, values)
plt.xlabel('Category')
plt.ylabel('Value')
plt.title('Bar Chart')
plt.show()
Use plt.barh() for horizontal bars.
Q66. What is the difference between bar chart and histogram?
Answer: Bar charts compare categorical data (discrete categories) with gaps between bars. Histograms show distribution of continuous numerical data by grouping values into bins (ranges) with no gaps. Bar charts use specified categories; histograms create bins automatically.
Q67. How do you create a pie chart?
Answer:
labels = ['A','B','C']
sizes = [30,45,25]
plt.pie(sizes, labels=labels, autopct='%1.1f%%')
plt.title('Pie Chart')
plt.show()
autopct shows percentages, explode separates slices.
Q68. How do you create multiple subplots?
Answer:
fig, (ax1, ax2) = plt.subplots(1, 2)
ax1.plot([1,2,3], [4,5,6])
ax2.bar(['A','B'], [10,20])
plt.show()
Or use plt.subplot(rows, cols, position) for each plot.
Q69. How do you customize plot colors and styles?
Answer: Colors: color='red', color='#FF5733', color='r'. Styles: linestyle='--' (dashed), ':' (dotted), '-.' (dash-dot). Markers: marker='o', 's' (square), '^' (triangle). Combine: plt.plot(x, y, 'r--o').
Q70. What are plot labels and legends?
Answer: plt.xlabel('text') and plt.ylabel('text') label axes. plt.title('text') adds title. plt.legend(['label1','label2']) or use label parameter in plot function: plt.plot(x, y, label='Line 1'), then plt.legend().
Q71. How do you save plots to files?
Answer: plt.savefig('filename.png') saves current figure. Parameters: dpi=300 (resolution), bbox_inches='tight' (removes whitespace), format='pdf' (file format). Call before plt.show() to save properly.
Q72. What is a scatter plot? When is it used?
Answer: Scatter plot displays individual data points using dots to show relationship between two variables. Used to identify correlations, patterns, clusters, and outliers. Create with: plt.scatter(x, y). Can vary size (s=) and color (c=) of points.
Q73. How do you create a histogram?
Answer:
data = [1,2,2,3,3,3,4,4,5]
plt.hist(data, bins=5, edgecolor='black')
plt.xlabel('Value')
plt.ylabel('Frequency')
plt.title('Histogram')
plt.show()
bins controls number of intervals.
Q74. What is Seaborn? How is it different from Matplotlib?
Answer: Seaborn is built on Matplotlib and provides high-level interface for statistical graphics. It has attractive default styles, built-in themes, and specialized plots (violin, pair plots). Easier syntax for complex statistical visualizations. Uses Matplotlib underneath.
Q75. How do you adjust figure size in plots?
Answer: Before plotting: plt.figure(figsize=(width, height)) where dimensions are in inches. Example: plt.figure(figsize=(10, 6)). For subplots: fig, ax = plt.subplots(figsize=(10,6)). Default is 6.4 x 4.8 inches.
Section 6: Database and SQL (Questions 76-95)
Q76. What is a database?
Answer: A database is an organized collection of structured data stored electronically. It allows efficient storage, retrieval, modification, and management of data. Examples: MySQL, PostgreSQL, Oracle, SQLite. Databases use tables with rows and columns.
Q77. What is SQL?
Answer: SQL (Structured Query Language) is a standard programming language for managing relational databases. It’s used to create, read, update, delete (CRUD) data. Common operations: SELECT (retrieve), INSERT (add), UPDATE (modify), DELETE (remove).
Q78. What is a primary key?
Answer: A primary key uniquely identifies each record in a table. It must contain unique values and cannot be NULL. Each table can have only one primary key, which can be single column or combination of columns (composite key).
Q79. What is a foreign key?
Answer: A foreign key is a field in one table that refers to the primary key in another table. It establishes relationships between tables and maintains referential integrity. Example: StudentID in Marks table referencing StudentID in Student table.
Q80. What are the different types of SQL commands?
Answer: DDL (Data Definition Language): CREATE, ALTER, DROP. DML (Data Manipulation Language): INSERT, UPDATE, DELETE, SELECT. DCL (Data Control Language): GRANT, REVOKE. TCL (Transaction Control Language): COMMIT, ROLLBACK.
Q81. How do you create a table in SQL?
Answer:
CREATE TABLE Students (
StudentID INT PRIMARY KEY,
Name VARCHAR(50),
Age INT,
City VARCHAR(30)
);
Q82. How do you insert data into a table?
Answer:
INSERT INTO Students (StudentID, Name, Age, City)
VALUES (1, 'Rahul', 17, 'Delhi');
Or multiple rows:
INSERT INTO Students VALUES
(2, 'Priya', 18, 'Mumbai'),
(3, 'Amit', 17, 'Kolkata');
Q83. How do you retrieve data using SELECT?
Answer:
SELECT * FROM Students; -- All columns
SELECT Name, Age FROM Students; -- Specific columns
SELECT * FROM Students WHERE Age > 17; -- With condition
SELECT DISTINCT City FROM Students; -- Unique values
Q84. What are SQL WHERE clause operators?
Answer: Comparison: =, !=, >, <, >=, <=. Logical: AND, OR, NOT. Range: BETWEEN. Pattern: LIKE. List: IN. NULL check: IS NULL, IS NOT NULL. Example: WHERE Age > 17 AND City = 'Delhi'.
Q85. What is the difference between WHERE and HAVING?
Answer: WHERE filters rows before grouping, works with individual records. HAVING filters groups after GROUP BY, works with aggregate results. Example: WHERE Age > 17 filters students; HAVING AVG(Marks) > 75 filters grouped averages.
Q86. How do you use ORDER BY clause?
Answer:
SELECT * FROM Students ORDER BY Name; -- Ascending (default)
SELECT * FROM Students ORDER BY Age DESC; -- Descending
SELECT * FROM Students ORDER BY City, Name; -- Multiple columns
Q87. What are SQL aggregate functions?
Answer: COUNT() counts rows, SUM() totals values, AVG() calculates average, MAX() finds maximum, MIN() finds minimum. Used with GROUP BY: SELECT City, COUNT(*) FROM Students GROUP BY City; counts students per city.
Q88. How do you update existing records?
Answer:
UPDATE Students
SET Age = 18, City = 'Chennai'
WHERE StudentID = 1;
Always use WHERE clause to avoid updating all records.
Q89. How do you delete records from a table?
Answer:
DELETE FROM Students WHERE StudentID = 1; -- Delete specific record
DELETE FROM Students WHERE Age < 16; -- Delete multiple
DELETE FROM Students; -- Delete all records (use carefully)
Q90. What is the LIKE operator in SQL?
Answer: LIKE searches for patterns in text. Wildcards: % (zero or more characters), _ (exactly one character). Examples: WHERE Name LIKE 'R%' (starts with R), WHERE Name LIKE '%a' (ends with a), WHERE Name LIKE '%am%' (contains am).
Q91. What is GROUP BY clause?
Answer: Groups rows with same values in specified column(s). Used with aggregate functions. Example:
SELECT City, COUNT(*), AVG(Age)
FROM Students
GROUP BY City;
Shows count and average age per city.
Q92. How do you use LIMIT clause?
Answer:
SELECT * FROM Students LIMIT 5; -- First 5 records
SELECT * FROM Students LIMIT 5 OFFSET 10; -- Skip 10, then get 5
Useful for pagination. MySQL uses LIMIT; other databases might use TOP or FETCH.
Q93. What are SQL joins? Name the types.
Answer: Joins combine rows from two or more tables based on related columns. Types: INNER JOIN (matching records from both), LEFT JOIN (all from left + matching from right), RIGHT JOIN (all from right + matching from left), FULL OUTER JOIN (all records from both).
Q94. How do you connect Python to MySQL database?
Answer:
import mysql.connector
conn = mysql.connector.connect(
host='localhost',
user='username',
password='password',
database='dbname'
)
cursor = conn.cursor()
cursor.execute("SELECT * FROM table")
result = cursor.fetchall()
conn.close()
Q95. What is the difference between DELETE and DROP?
Answer: DELETE removes specific rows from table, table structure remains: DELETE FROM Students WHERE Age < 16. DROP removes entire table including structure and data: DROP TABLE Students. DELETE can use WHERE clause and be rolled back; DROP cannot.
Section 7: Data Handling (Questions 96-105)
Q96. What is CSV file format?
Answer: CSV (Comma-Separated Values) is a plain text format where values are separated by commas. Each line represents a data record. Easy to read/write, compatible with Excel and databases. Example: Name,Age,City header row followed by Rahul,17,Delhi data rows.
Q97. How do you read CSV files in Python?
Answer: Using Pandas: df = pd.read_csv('file.csv'). Using csv module:
import csv
with open('file.csv', 'r') as file:
reader = csv.reader(file)
for row in reader:
print(row)
Q98. How do you write data to CSV file?
Answer: Using Pandas: df.to_csv('file.csv', index=False). Using csv module:
import csv
with open('file.csv', 'w', newline='') as file:
writer = csv.writer(file)
writer.writerow(['Name', 'Age'])
writer.writerow(['Rahul', 17])
Q99. What is data cleaning? Why is it important?
Answer: Data cleaning is the process of detecting and correcting errors, inconsistencies, and inaccuracies in data. Important because: improves data quality, ensures accurate analysis, removes duplicates/missing values, and makes data ready for analysis. Common tasks: handling nulls, removing duplicates, correcting formats.
Q100. How do you handle duplicate data in DataFrame?
Answer: Detect: df.duplicated() returns boolean Series. Count: df.duplicated().sum(). Remove: df.drop_duplicates() removes all duplicates, df.drop_duplicates(subset=['col1']) checks specific columns, keep='first' (default), 'last', or False (remove all).
Q101. What are different file modes in Python?
Answer: ‘r’ (read, default), ‘w’ (write, overwrites), ‘a’ (append), ‘r+’ (read+write), ‘w+’ (write+read), ‘x’ (exclusive creation), ‘b’ (binary mode), ‘t’ (text mode, default). Combine: ‘rb’ (read binary), ‘wb’ (write binary).
Q102. How do you read and write text files in Python?
Answer:
# Reading
with open('file.txt', 'r') as f:
content = f.read() # Entire file
# or f.readline() # One line
# or f.readlines() # List of lines
# Writing
with open('file.txt', 'w') as f:
f.write('Hello World')
Q103. What is JSON format? How do you handle it in Python?
Answer: JSON (JavaScript Object Notation) is a lightweight data format using key-value pairs. Similar to Python dictionaries. Reading: import json; data = json.load(file) or json.loads(string). Writing: json.dump(data, file) or json.dumps(data).
Q104. What is data normalization?
Answer: Data normalization scales numerical data to a standard range (usually 0-1 or -1 to 1) without distorting differences. Formula: (x - min) / (max - min). Important for machine learning algorithms sensitive to scale. Use sklearn.preprocessing.MinMaxScaler() or manual calculation.
Q105. What is the difference between Series and DataFrame?
Answer: Series is one-dimensional (single column) with index and values. DataFrame is two-dimensional (multiple columns) like a table. Series is a single column of DataFrame. df['column'] returns Series; df[['column']] returns DataFrame.
Section 8: Societal Impact & Security (Questions 106-115)
Q106. What is Intellectual Property Rights (IPR)?
Answer: IPR protects creations of mind like inventions, artistic works, symbols, names, and images. Types: Copyright (creative works), Patents (inventions), Trademarks (brand identity), Trade secrets. Gives creators exclusive rights and prevents unauthorized use.
Q107. What is a copyright?
Answer: Copyright is legal right protecting original creative works (books, music, software, art) from unauthorized copying, distribution, or modification. Automatically granted upon creation. Symbol: ©. Duration: typically author’s lifetime plus 60 years in India.
Q108. What is Open Source Software?
Answer: Software with source code freely available for anyone to view, modify, and distribute. Examples: Linux, Python, MySQL, Apache. Benefits: free to use, community-driven development, transparent, customizable. Popular licenses: GPL, MIT, Apache.
Q109. What is proprietary software?
Answer: Software where source code is not available and use is restricted by license. Users must purchase license. Examples: Microsoft Windows, Adobe Photoshop, Oracle. Company owns rights, provides support, but limited customization. Opposite of open source.
Q110. What is plagiarism?
Answer: Plagiarism is presenting someone else’s work, ideas, or words as your own without proper attribution. Types: direct copying, paraphrasing without credit, self-plagiarism. Consequences: academic penalties, legal action, damaged reputation. Always cite sources properly.
Q111. What is cybercrime? Give examples.
Answer: Illegal activities using computers or internet. Examples: Hacking (unauthorized access), Phishing (fake emails to steal data), Identity theft, Ransomware attacks, Cyberbullying, Online fraud, Data breach, DDoS attacks. Punishable under IT Act 2000 in India.
Q112. What is cyber safety?
Answer: Practices to protect yourself online. Includes: using strong passwords, avoiding suspicious links, not sharing personal information, using antivirus software, regular updates, secure websites (HTTPS), two-factor authentication, being careful on social media.
Q113. What is net etiquette (Netiquette)?
Answer: Rules of proper online behavior. Guidelines: be respectful, avoid ALL CAPS (shouting), no spam, respect privacy, verify before sharing, give credit, avoid offensive content, be concise, think before posting, respect copyrights.
Q114. What is digital footprint?
Answer: Trail of data you leave online through activities like browsing, posting, shopping. Two types: Active (deliberately shared – posts, emails) and Passive (collected without knowledge – cookies, IP address). Can affect reputation, employment. Be mindful of online activities.
Q115. What is two-factor authentication (2FA)?
Answer: Security method requiring two different verification forms: something you know (password) and something you have (phone, token). Adds extra security layer. Even if password is stolen, account remains protected. Examples: OTP via SMS, authenticator apps, biometrics.
Section 9: Data Science Concepts (Questions 116-125)
Q116. What is Data Science?
Answer: Interdisciplinary field extracting insights from structured and unstructured data using scientific methods, algorithms, and systems. Combines statistics, mathematics, programming, and domain knowledge. Applications: business analytics, healthcare, finance, recommendation systems.
Q117. What is the difference between data and information?
Answer: Data is raw, unprocessed facts and figures (numbers, text, images). Information is processed, organized, and meaningful data. Example: “25, 30, 28” is data; “Average temperature is 27.67°C” is information. Data becomes information through processing and context.
Q118. What are structured and unstructured data?
Answer: Structured data is organized in fixed format (tables, databases) – easy to search and analyze. Example: Excel spreadsheets, SQL databases. Unstructured data has no predefined format (emails, videos, images, social media posts) – harder to process but contains valuable insights.
Q119. What is Big Data? What are its characteristics?
Answer: Extremely large datasets that traditional tools cannot process. 5 V’s: Volume (massive amount), Velocity (high speed generation), Variety (different types), Veracity (accuracy/quality), Value (meaningful insights). Examples: social media data, sensor data, transaction logs.
Q120. What is data analytics?
Answer: Process of examining data to draw conclusions and support decision-making. Types: Descriptive (what happened), Diagnostic (why it happened), Predictive (what will happen), Prescriptive (what should be done). Uses statistical analysis, machine learning, visualization.
Q121. What is the difference between Data Science and Data Analytics?
Answer: Data Science is broader – builds models, creates algorithms, works with structured/unstructured data, focuses on future predictions. Data Analytics is narrower – analyzes existing data, answers specific questions, primarily structured data, focuses on past/present insights.
Q122. What are the steps in data analysis process?
Answer: 1) Problem definition 2) Data collection 3) Data cleaning 4) Data exploration (EDA) 5) Data analysis (statistical/ML) 6) Data visualization 7) Interpretation 8) Communication of results. Iterative process that may require revisiting earlier steps.
Q123. What is Exploratory Data Analysis (EDA)?
Answer: Initial investigation of data to discover patterns, spot anomalies, test hypotheses, and check assumptions using statistics and visualization. Includes: summary statistics, distributions, correlations, outlier detection. Done before formal modeling. Uses plots like histograms, box plots, scatter plots.
Q124. What is correlation? What does correlation coefficient mean?
Answer: Correlation measures relationship between two variables. Correlation coefficient (r) ranges from -1 to +1: +1 (perfect positive), 0 (no correlation), -1 (perfect negative). Example: height and weight typically have positive correlation. Correlation doesn’t imply causation.
Q125. What is the difference between mean, median, and mode?
Answer: Mean is average (sum/count). Median is middle value when sorted (50th percentile). Mode is most frequent value. Use mean for normal distribution, median for skewed data (less affected by outliers), mode for categorical data. Example: [1,2,2,3,100] – mean=21.6, median=2, mode=2.
Additional Important Topics (Questions 126-130)
Q126. What is API (Application Programming Interface)?
Answer: Set of rules and protocols allowing different software applications to communicate. Acts as intermediary between programs. Example: Weather apps use weather API to fetch data. RESTful APIs use HTTP methods (GET, POST, PUT, DELETE). APIs enable integration and data sharing.
Q127. What is cloud computing?
Answer: Delivery of computing services (storage, servers, databases, software) over internet. Types: IaaS (Infrastructure), PaaS (Platform), SaaS (Software). Benefits: cost-effective, scalable, accessible anywhere, automatic updates. Examples: Google Drive, AWS, Microsoft Azure, Dropbox.
Q128. What is IoT (Internet of Things)?
Answer: Network of physical devices embedded with sensors, software connecting and exchanging data over internet. Examples: smart watches, home automation, smart appliances, fitness trackers. Applications: healthcare monitoring, agriculture, smart cities, industrial automation.
Q129. What is Artificial Intelligence (AI) and Machine Learning (ML)?
Answer: AI is simulation of human intelligence in machines – learning, reasoning, problem-solving. ML is subset of AI where systems learn from data without explicit programming. Examples: recommendation systems, image recognition, chatbots, predictive analytics. Uses algorithms to find patterns.
Q130. What is the importance of data privacy?
Answer: Protecting personal information from unauthorized access. Important because: prevents identity theft, maintains trust, legal requirement (GDPR, IT Act), protects sensitive information, prevents misuse. Practices: encryption, access controls, anonymization, consent-based data collection, secure storage.
Practical Examination Tips
Important Points to Remember:
- Be confident – Speak clearly and maintain eye contact
- Understand concepts – Don’t just memorize; understand the logic
- Practice coding – Be ready to write or explain code snippets
- Know your program – Understand every line of code you submit
- Be honest – If you don’t know, say so politely rather than guessing
- Stay calm – Take a moment to think before answering
- Use examples – Real-world examples make answers stronger
- Review basics – Examiners often start with fundamental questions
Common Examiner Questions:
- “Explain your program” – Walk through your practical file program
- “What is the output?” – Be ready to trace code execution
- “What if we change this?” – Understand how modifications affect results
- “Why did you use this method?” – Justify your approach
- “Can you write syntax for…?” – Know basic syntax by heart
Topics to Focus On:
- ✓ DataFrame operations (creation, indexing, filtering)
- ✓ Data visualization (types of charts, when to use each)
- ✓ SQL queries (SELECT, JOIN, GROUP BY)
- ✓ File handling (CSV operations)
- ✓ Python basics (data types, functions, control structures)
- ✓ Pandas methods (groupby, merge, pivot)
- ✓ Societal impacts (IPR, cybercrime, netiquette)
Conclusion
This comprehensive guide covers all essential topics for CBSE Class 12 Informatics Practices (065) practical viva examination 2025-26. Regular practice, understanding concepts rather than rote learning, and hands-on coding experience will ensure excellent performance.
Good luck with your board exams!
