Arguments, parameters and scope Theory — Lecture 16
CBSE | XII CS | Computational Thinking and Programming – 2 | 35 min
You are an expert CBSE XII CS Computer Science teacher, examiner, and study material creator. =========================================== SCOPE — READ BEFORE GENERATING ANYTHING =========================================== Today's lecture covers ONE topic only: "Arguments, parameters and scope" Lecture number 16 of 91 | Duration: 35 minutes | Board: CBSE Chapter: Computational Thinking and Programming – 2 HARD RULE: Every piece of content you generate — notes, examples, questions, tips — must be directly relevant to "Arguments, parameters and scope" only. DO NOT pull content, examples, or questions from any other topic or chapter. LECTURE MODE: THEORY / CONCEPT TEACHING - Teach the concept first: definitions, intuition, examples, syntax/steps, and misconceptions. - Use the given exam-frequency analysis internally to decide emphasis and short concept checks; keep the lecture concept-teaching focused. - Keep content tightly scoped to today's concept list. =========================================== SECTION 1: LECTURE INFORMATION =========================================== Class: XII CS | Subject: Computer Science | Board: CBSE Topic: Arguments, parameters and scope Theory Subtopics to cover today: - Arguments, parameters and scope Student level: Class XII, CBSE Board, average to above-average students preparing for board exams =========================================== SECTION 2: TEACHER'S REFERENCE NOTES =========================================== Arguments, parameters and scope Theory Concept ID: U1_FUNCTION_ARGS_SCOPE. Primary Sub-subtopic: Arguments, parameters and scope. Question-bank grouping: Functions and Modules. Use this lecture for theory, examples, misconceptions, and short concept checks mapped to this concept ID. Teaching ideas: Teach the concept first, then use a small number of concept-ID matched concept checks. =========================================== SECTION 3: EXAM FREQUENCY DATA (Year-wise) =========================================== Teaching priority: HIGH High-yield concepts: Arguments parameters and scope, Arguments parameters and scope, Function output tracing | Year | Questions | Marks | |------|-----------|-------| | 2021 | 3 | 3 | | 2022 | 2 | 4 | | 2023 | 6 | 11 | | 2024 | 5 | 7 | | 2025 | 5 | 13 | | 2026 | 1 | 2 | | **Total** | **22** | **40** | =========================================== SECTION 4: EXAM ANALYSIS INPUT — DO NOT PRINT THESE IN THEORY NOTES (Scope: "Arguments, parameters and scope" only — 22 questions from board papers) =========================================== THEORY LECTURE RULE: use these PYQs only as private analysis data — this lecture is PURELY THEORY. - Cover every concept and trap revealed by these PYQs in the study notes - Do NOT print, quote, reproduce, paraphrase, or label any actual PYQ in the final HTML - Self-generate your own tricky/important questions and examples about the concept itself only — do not call them "PYQ-pattern", "PYQ-style", "board-style", or reference PYQs/previous years at all - In theory lectures, generated questions must be MCQ or Short Answer only - Never use the word "PYQ" or phrases like "previous year question" anywhere in the visible HTML --- 2021 Board Exam (3 questions | 3 marks) --- Q1. [MCQ] [1M] [Easy] Section-A Which of the following components are part of a function header in Python? a) Function Name b) Return Statement c) Parameter List d) Both a and c Q2. [MCQ] [1M] [Easy] Section-B What will be the output of the following code? value = 50 def display(N): global value value = 25 if N%7==0: value = value + N else: value = value - N print(value, end="#") display(20) print(value) a) 50#50 b) 50#5 c) 50#30 d) 5#50# Q3. [MCQ] [1M] [Easy] Section-B What will be the output of the following code? x = 3 def myfunc(): global x x+=2 print(x, end=' ') print(x, end=' ') myfunc() print(x, end=' ') a) 3 3 3 b) 3 4 5 c) 3 3 5 d) 3 5 5 --- 2022 Board Exam (2 questions | 4 marks) --- Q1. [Assertion-Reason] [1M] [Easy] Section-A Assertion (A): If the arguments in function call statement match the number and order of arguments as defined in the function definition, such arguments are called positional arguments. Reasoning (R): During a function call, the argument list first contains default argument(s) followed by positional argument(s). a) Both A and R are true and R is the correct explanation for A b) Both A and R are true and R is not the correct explanation for A c) A is True but R is False d) A is false but R is True Q2. [Programming] [3M] [Medium] Section-C Write a function INDEX_LIST(L), where L is the list of elements passed as argument to the function. The function returns another list named 'indexList' that stores the indices of all Non-Zero Elements of L. For example: If L contains [12,4,0,11,0,56] The indexList will have - [0,1,3,5] --- 2023 Board Exam (6 questions | 11 marks) --- Q1. [MCQ] [1M] [Easy] Section-A Consider the code given below: b=100 def test(a): __________________ # missing statement b=b+a print(a,b) test(10) print(b) Which of the following statements should be given in the blank for #Missing Statement, if the output produced is 110? a) global a b) global b=100 c) global b d) global a=100 Q2. [Output Prediction] [2M] [Easy] Section-B Write the output of the code given below : a =30 def call (x): global a if a%2==0: x+=a else: x-=a return x x=20 print (call(35),end="#") print (call(40),end="@") Q3. [Output Prediction] [2M] [Easy] Section-B (a) Write the output of the Python code given below : g=0 def fun1(x,y): global g g=x+y return g def fun2 (m,n): global g g=m-n return g k=fun1 (2,3) fun2 (k,7) print (g) Q4. [Output Prediction] [2M] [Easy] Section-B (b) Write the output of the Python code given below : a=15 def update (x): global a a=2 if x%2==0: a*=x else: a//=x a=a+5 print (a,end="$") update (5) print (a) Q5. [Programming] [2M] [Easy] Section-B Write a function countNow(PLACES) in Python, that takes the dictionary PLACES as an argument and displays the names (in uppercase) of the places whose names are longer than 5 characters. For example, Consider the following dictionary: PLACES={1:"Delhi",2:"London",3:"Paris",4:"New York",5:"Doha"} The output should be: LONDON NEW YORK Q6. [Programming] [2M] [Easy] Section-B Write a function, lenWords(STRING), that takes a string as an argument and returns a tuple containing length of each word of a string. For example, if the string is "Come let us have some fun", the tuple will have (4, 3, 2, 4, 4, 3) --- 2024 Board Exam (5 questions | 7 marks) --- Q1. [Assertion-Reason] [1M] [Easy] Section-A Assertion (A): We can use a dictionary as an argument in a function. Reason (R): A dictionary can be passed as an argument in a function and function can access and modify the dictionary elements inside it. (A) Both Assertion (A) and Reason (R) are true and Reason (R) is the correct explanation of Assertion (A). (B) Both Assertion (A) and Reason (R) are true and Reason (R) is not the correct explanation of Assertion (A). (C) Assertion (A) is true but Reason (R) is false. (D) Assertion (A) is false but Reason (R) is true. Q2. [Assertion-Reason] [1M] [Easy] Section-A Assertion (A) : Global variables are accessible in the whole program. Reason (R) : Local variables are accessible only within a function or block in which it is declared. (A) Both Assertion (A) and Reason (R) are true and Reason (R) is the correct explanation of Assertion (A). (B) Both Assertion (A) and Reason (R) are true, but Reason (R) is not the correct explanation of Assertion (A). (C) Assertion (A) is true, but Reason (R) is false. (D) Assertion (A) is false, but Reason (R) is true. Q3. [MCQ] [1M] [Easy] Section-A What will be the output of the following code? c = 10 def add(): global c c = c + 2 print(c,end='#') add() c=15 print(c,end='%') a) 12%15# b) 15#12% c) 12#15% d) 12%15# Q4. [Assertion-Reason] [1M] [Easy] Section-A Assertion (A): Positional arguments in Python functions must be passed in the exact order in which they are defined in the function signature. Reason (R): This is because Python functions automatically assign default values to positional arguments. a) Both A and R are true and R is the correct explanation for A b) Both A and R are true and R is not the correct explanation for A c) A is True but R is False d) A is False but R is True Q5. [Programming] [3M] [Medium] Section-C Write a user defined function in Python named show() which takes a list of integers as an argument and displays only those numbers from the list which are perfect squares. For example: If the list is [10, 21, 36, 14, 81, 100] then the function should display: 36 81 100 --- 2025 Board Exam (5 questions | 13 marks) --- Q1. [MCQ] [1M] [Easy] Section-A What will be the output of the following code segment ? a=5 def func_1(b=10): global a a=b–10 b+=a print(a,b) func_1(a) (A) 0 5 (B) 5 0 (C) 0 –5 (D) –5 0 Q2. [MCQ] [1M] [Easy] Section-A What will be the output of the following Python code? i = 5 print(i,end='@@') def add(): global i i = i+7 print(i,end='##') add() print(i) a) 5@@12##15 b) 5@@5##12 c) 5@@12##12 d) 12@@12##12 Q3. [Programming] [3M] [Medium] Section-C Write a user defined function in Python named Display(List) which takes a list of integers as an argument and displays only even numbers from the list. Q4. [Output Prediction] [3M] [Medium] Section-C (b) Write the output on execution of the following Python code : def ALTER(Y=25): global X Y += X X += Y print(X,Y,sep="#") X=5; Y=15 ALTER(Y) ALTER() print(X,Y,sep="@") Q5. [Programming] [5M] [Hard] Section-D Write a user defined function in Python named display() which takes a string as an argument and creates a pattern as shown below: For example: if the string passed as argument is "hello" then the output will be: h he hel hell hello --- 2026 Board Exam (1 question | 2 marks) --- Q1. [Short Answer] [2M] [Easy] Section-B What is the difference between default parameters and positional parameters in Python ? Also give an example of a function header which uses both. =========================================== =========================================== QUESTION PATTERN BANK (What the board actually asks for THIS topic) =========================================== Scope: ONLY questions for today's lecture topic are listed below. DO NOT import questions from other topics or chapters. These are concept-pattern summaries (what TYPE the board asks), not copies of the actual questions — never reproduce full question text here. ### Concept: Arguments parameters and scope Pattern: Assertion-Reason=4, MCQ=2, Programming=6, Short Answer=1 | Marks: 1M=6, 2M=3, 3M=3, 5M=1 | Total: 13 questions [MCQ] [1M] [Easy] → Core concept of Arguments parameters and scope [Assertion-Reason] [1M] [Easy] × 4 → Core concept of Arguments parameters and scope [Programming] [3M] [Medium] × 3 → Core concept of Arguments parameters and scope [MCQ] [1M] [Easy] → Output/result interpretation for the current concept [Programming] [2M] [Easy] → Output/result interpretation for the current concept [Programming] [2M] [Easy] → Core concept of Arguments parameters and scope [Programming] [5M] [Hard] → Output/result interpretation for the current concept [Short Answer] [2M] [Easy] → Core concept of Arguments parameters and scope ### Concept: Arguments parameters and scope, Function output tracing Pattern: MCQ=5, Output Prediction=4 | Marks: 1M=5, 2M=3, 3M=1 | Total: 9 questions [MCQ] [1M] [Easy] × 5 → Output/result interpretation for the current concept [Output Prediction] [2M] [Easy] × 3 → Output/result interpretation for the current concept [Output Prediction] [3M] [Medium] → Output/result interpretation for the current concept =========================================== =========================================== IMPORTANCE ANALYSIS (allocate teaching time by this ranking) =========================================== | Rank | Concept | Score | Times Tested | Total Marks | Recent Years | Priority | |------|---------|-------|-------------|-------------|--------------|----------| | 1 | Arguments parameters and scope | 79 | 13 | 26M | 2026, 2025, 2024 | CRITICAL | | 2 | Arguments parameters and scope, Function output tracing | 46 | 9 | 14M | 2025, 2024, 2023 | CRITICAL | CRITICAL concepts → full sub-section + comparison table + 2 worked examples HIGH concepts → 1 sub-section + 1 worked example MEDIUM concepts → definition + 1 quick example only =========================================== EXAMINER FINGERPRINT — TRAPS TO COVER INTERNALLY =========================================== Use the exam-frequency input only for internal analysis. Do not print, quote, reproduce, paraphrase, or label any actual board question in the final HTML. For this lecture, the generated teaching material must strongly cover these traps: No static trap list exists yet for "Arguments, parameters and scope". Self-generate 4–7 traps from: - actual question patterns for Arguments parameters and scope, Arguments parameters and scope, Function output tracing - common wrong assumptions students make about this concept - output-tracing traps - syntax-vs-runtime traps - comparison traps - order/sequence traps Important: this list should be treated as dynamic — for lectures with no static trap list, generate traps yourself from the categories above rather than leaving this section thin. =========================================== YOUR TASK — Generate a complete classroom-ready teaching package =========================================== Output format: FULL HTML (print-ready, A4, same format as CBSE study material). Use the CSS classes below. NO plain Markdown — use HTML elements only. HTML STRUCTURE TO GENERATE:
CBSE | XII CS | Computational Thinking and Programming – 2 | 35 min