INTRODUCTION TO PROBLEMSOLVING
Multiple Choice Questions
1. What is the first step in problem-solving as per the textbook?
a) Testing the solution b) Coding the algorithm
c) Analyzing the problem d) Debugging the program
2. What is an algorithm?
a) A set of exact steps to solve a problem b) A programming language
c) A type of computer hardware d) A method of debugging
3. What does the term “computerization” refer to?
a) The use of computers to develop software for automating tasks
b) The physical components of a computer system
c) The process of debugging a program
d) The network connectivity of computers
4. Which of the following is NOT a characteristic of a good algorithm?
a) Precision b) Uniqueness
c) Infinite steps d) Finiteness
5. What does the process of ‘coding’involve?
a) Writing an algorithm
b) Testing the program
c) Converting the algorithm into a format understood by the computer
d) Debugging the code
6. What shape is used to represent a process in a flowchart?
a) Parallelogram b) Rectangle
c) Diamond d) Circle
7. In a flowchart, which symbol represents the start or end?
a) Diamond b) Rectangle
c) Oval d) Parallelogram
8. What is the purpose of developing an algorithm before writing code?
a) To debug the program b) To convert it into machine language
c) To have a clear solution plan d) To test the program
9. Which step comes immediately after developing an algorithm?
a) Debugging b) Testing
c) Coding d) Analyzing the problem
10. What does GIGO stand for?
a) Garbage In, Garbage Out b) Good Input, Good Output
c) Great Input, Great Output d) Generated Input, Generated Output 11. What does ‘finiteness’in
an algorithm mean?
a) The algorithm stops after a finite number of steps
b) The algorithm has infinite steps
c) The algorithm has unique steps
d) The algorithm processes data infinitely
12. Which of the following is an essential skill for a computer science student?
a) Problem-solving b) Debugging
c) Coding d) All of the above
13. What is the output of an algorithm?
a) Input data b) A set of instructions
c) The result of the process d) A debugging report
14. What does the parallelogram symbol in a flowchart represent?
a) Process b) Decision
c) Input/Output d) Start/End
15. Which of the following steps is NOT part of the problem-solving process mentioned
in the textbook?
a) Analyzing the problem b) Developing an algorithm
c) Compiling the code d) Testing and debugging
16. What should be done after finalizing the algorithm?
a) Debugging b) Testing
c) Coding d) Analyzing the problem
17. Why is it important to textbook the coding procedures?
a) To make the code run faster
b) To understand the logic at a later stage
c) To avoid writing an algorithm
d) To reduce the size of the program
18. What is the role of testing in the problem-solving process?
a) To analyze the problem
b) To write the algorithm
c) To check if the program meets user requirements
d) To convert the algorithm into code
19. Which of the following is a key component of analyzing a problem?
a) Writing the program code
b) Listing the principal components of the problem
c) Testing the solution
d) Debugging the program
20. What is the primary purpose of using an algorithm?
a) To debug the program
b) To test the program
c) To increase reliability, accuracy, and efficiency
d) To compile the program 21. What does the diamond shape in a flowchart represent?
a) Process b) Decision
c) Input/Output d) Start/End
22. Which programming language can be used to write a program after developing
an algorithm?
a) Only Python b) Any high-level language
c) Only Java d) Only C++
23. What must be done if the program generates incorrect output?
a) Analyze the problem b) Develop a new algorithm
c) Check for logical errors d) Ignore the output
24. Why is a roadmap important for a programmer?
a) To debug the program
b) To clearly visualize the instructions to be written
c) To reduce the size of the program
d) To increase the speed of the program
25. What is the function of a ‘terminator’symbol in a flowchart?
a) To represent a decision point
b) To indicate the start or end of the process
c) To show data input/output
d) To represent a process or action
26. What should be done after coding the algorithm?
a) Analyzing the problem b) Testing and debugging
c) Developing the algorithm d) Writing the problem statement
27. Why is precision important in an algorithm?
a) To reduce the number of steps
b) To ensure the steps are clearly stated and defined
c) To make the algorithm run faster
d) To avoid using high-level language
28. Which step in problem-solving involves identifying the logical steps to reach a
solution?
a) Analyzing the problem b) Developing the algorithm
c) Coding d) Testing and debugging
29. Which shape in a flowchart represents input or output data?
a) Oval b) Rectangle
c) Parallelogram d) Diamond
30. Why is uniqueness important in an algorithm?
a) To ensure each step is uniquely defined
b) To make the algorithm run faster
c) To reduce the number of steps
d) To avoid using high-level language 31. What is the primary objective of problem-solving in
computer science?
a) To debug the program
b) To automate tasks efficiently
c) To reduce the size of the program
d) To increase the speed of the program
32. In a flowchart, what is used to represent a decision?
a) Oval b) Rectangle
c) Diamond d) Parallelogram
33. What should be the next step if an algorithm is not producing the correct
output?
a) Ignoring the error
b) Rewriting the problem statement
c) Revising the algorithm to check for logical errors
d) Converting it into a flowchart
34. Why is it necessary to document the coding process?
a) To write more complex code
b) To ensure the code is understandable and maintainable
c) To reduce the size of the code
d) To avoid using high-level language
35. What role does testing play in the problem-solving process?
a) To identify any logical errors in the algorithm
b) To write the final algorithm
c) To analyze the problem statement
d) To convert the algorithm into code
36. What is the purpose of a flowchart?
a) To represent an algorithm visually b) To write the code
c) To debug the program d) To test the solution
37. Which of the following is NOT a step in the problem-solving process?
a) Analyzing the problem b) Writing the program
c) Testing and debugging d) Developing the algorithm
38. What is ‘finiteness’in the context of an algorithm?
a) The algorithm must have a finite number of steps
b) The algorithm must run indefinitely
c) The algorithm should have unique steps
d) The algorithm must have infinite steps
39. Why is it necessary to debug a program?
a) To increase the size of the code
b) To ensure the program runs without errors
c) To write the algorithm
d) To develop the problem statement 40. What does a rectangle represent in a flowchart?
a) Decision b) Input/Output
c) Start/End d) Process
41. Which step involves checking if a program meets user requirements?
a) Analyzing the problem b) Developing the algorithm
c) Coding d) Testing
42. What is the outcome of an algorithm?
a) Analyzing the problem b) Writing the program
c) Producing a result d) Debugging the program
43. What is the significance of ‘precision’in an algorithm?
a) To reduce the number of steps
b) To ensure each step is clearly defined
c) To make the algorithm faster
d) To avoid using high-level language
44. Why is it important to develop an algorithm before coding?
a) To reduce the size of the program b) To have a clear solution plan
c) To debug the code d) To increase the speed of the program
45. What is the role of testing in programming?
a) To analyze the problem b) To write the code
c) To identify and fix errors d) To develop the algorithm
46. What shape represents the start or end in a flowchart?
a) Rectangle b) Parallelogram
c) Oval d) Diamond
47. Which of the following best describes ‘uniqueness’in an algorithm?
a) Each step is distinct and clearly defined
b) The algorithm has infinite steps
c) The algorithm runs indefinitely
d) The algorithm is written in a high-level language
48. What should be done if a program produces unexpected results?
a) Ignore the results b) Re-analyze the problem
c) Debug and test the program d) Write a new algorithm
49. What does the term ‘coding’ refer to in problem-solving?
a) Writing the problem statement
b) Converting the algorithm into a programming language
c) Testing the program
d) Analyzing the problem
50. Why is ‘debugging’ an essential part of problem-solving in programming?
a) To write the algorithm b) To fix errors in the code
c) To reduce the size of the program d) To develop the problem statement 51. Assertion (A) A
flow chart is type of diagram that represents the algorithm
graphicallyusing the boxes.
Reason (R) an algorithm where all the steps are executed in one after the other
a) Both A and R are true and R is the correct explanation for A
b) Both A and R are true but R is not the correct explanation for A
c) A is True but R is False
d) A is false but R is True
52. Assertion (A):A flowchart is a type of diagram that represents a workflow or process
Reason (R) :A flowchart can also be defined as a diagrammatic representation of an
algorithm
a) Both A and R are true and R is the correct explanation for A
b) Both A and R are true but R is not the correct explanation for A
c) A is True but R is False
d) A is false but R is True
53. Assertion (A):An algorithm is a procedure used for solving a problem or
performing acomputation.
Reason (R) :Algorithm may have infinite number of instructions.
a) Both A and R are true and R is the correct explanation for A
b) Both A and R are true but R is not the correct explanation for A
c) A is True but R is False
d) A is false but R is True
54. Assertion (A):Pseudocode requires strict programming language syntax
Reason (R) :Pseudocode summarizes a program's flow
a) Both A and R are true and R is the correct explanation for A
b) Both A and R are true but R is not the correct explanation for A
c) A is True but R is False
d) A is false but R is True
55. Assertion (A): The if Then flowchart statement is a two-way system that executes
two blocks of statements
Reason (R) :if the condition inside the if block is true, the program executes all
the statements within that if block.
a) Both A and R are true and R is the correct explanation for A
b) Both A and R are true but R is not the correct explanation for A
c) A is True but R is False
d) A is false but R is True 56. Assertion (A)Algorithm is a step by step procedure designed to
perform an
operation which will lead to the desired result.
Reason (R)An algorithm gives solutions in infinite number of steps. It does not
receive any input and produces some output.
a) A is true and R is correct explanation
b) A is false and R is incorrect explanation
c) A is true and R is incorrect explanation
d) A is false and R is correct explanation
57. Assertion (A)A flowchart is not a visual representation of an algorithm.
Reason (R)Flowchart is made up of boxes, diamonds and other shapes, connected by
arrows.
a) A is true and R is correct explanation
b) A is false and R is incorrect explanation
c) A is true and R is incorrect explanation
d) A is false and R is correct explanation
58. Assertion (A)Pseudocode is considered as a non-formal language that helps
programmers to write algorithm.
Reason (R)A pseudocode of a program helps in representing the basic functionality
of the intended program..
a) A is true and R is correct explanation
b) A is false and R is incorrect explanation
c) A is true and R is incorrect explanation
d) A is false and R is correct explanation
59. Assertion (A)A program written in machine language is called source code.
Reason (R)We need to translate the source code into object code using a compiler
or an interpreter.
a) A is true and R is True
b) A is false and R is true
c) A is false and R is true
d) A is true and R is false 2 Marks Questions
1. Define an algorithm.
2. What is pseudocode?
3. Explain the term "flowchart."
4. What are conditionals in programming?
5. What is the purpose of a flowchart?
6. Describe the term "sequence" in the context of algorithms.
7. What does iterative mean in algorithm design?
8. Why is it important to verify an algorithm?
9. What is a loop in programming?
10. What is the significance of decision making in algorithms?
11. Write pseudocode to add two numbers.
12. Define "space complexity" in algorithm analysis.
13. Define "time complexity" in algorithm analysis.
14. What are the components of a flowchart?
15. Explain the difference between pseudocode and a flowchart.
16. What is an Armstrong number?
17. Describe the term "branching" in algorithms.
18. What is a single-digit number algorithm?
19. Explain the term "aggregate marks."
20. What is the role of an algorithm in problem-solving?
3 Marks Questions
1. Write an algorithm to find the greatest of two numbers.
2. Explain the importance of pseudocode before actual coding.
3. Describe the process of writing a flowchart for a given algorithm.
4. How can you improve an algorithm that fails for certain inputs?
5. Write pseudocode for calculating the area and perimeter of a rectangle.
6. Explain the importance of conditionals with an example.
7. How do you calculate the percentage of marks in three subjects?
8. Describe the algorithm for checking whether a number is within a specific range.
9. Explain how to handle time addition in pseudocode when minutes exceed 60.
10. Discuss the significance of decision-making algorithms with a real-life example.
11. What steps should be taken if an algorithm has multiple approaches?
12. Explain the importance of verifying an algorithm with an example.
13. Describe the pseudocode to classify numbers as "Single Digit," "Double Digit," or
"Big."
14. Write an algorithm to calculate the water bill based on consumption.
15. What improvements can be made to an algorithm that only accepts positive
integers up to 100? 16. Explain the algorithm for determining the winner in a coin-flipping game.
17. Write the pseudocode to print all multiples of 5 between 10 and 25.
18. How do you write an algorithm to read the marks of three subjects and calculate
the aggregate?
19. What is the significance of iterative steps in an algorithm?
20. Describe the process of designing an algorithm to add hours and minutes.
5 Marks Questions
1. Write a detailed algorithm to determine the winner in a coin-flipping game.
2. Explain the importance of flowcharts in problem-solving with a detailed example.
3. Describe the algorithm for adding hours and minutes, including the necessary
conditionals.
4. Write the pseudocode and draw the flowchart for calculating the area and perimeter
of a rectangle.
5. Explain the importance of verifying algorithms with multiple examples.
6. Discuss the different approaches to solving a problem using algorithms.
7. Write a detailed algorithm to classify numbers as "Single Digit," "Double Digit," or
"Big."
8. Describe the steps involved in writing an algorithm for the total water bill
calculation.
9. Explain the process of improving an algorithm that fails for certain inputs with a
detailed example.
10. Write a detailed pseudocode to calculate the factorial of a number.
11. Describe the process of writing an algorithm that accepts only positive integers up
to 100.
12. Explain the steps involved in designing an algorithm for a coin-flipping game with
detailed conditionals.
13. Write a detailed algorithm to print all multiples of 5 between 10 and 25.
14. Describe the process of writing an algorithm to read the marks of three subjects
and calculate the percentage.
15. Explain the significance of iterative and branching steps in algorithm design with
examples
16. Explain the various steps involved in problem solving.
17. Explain the Characteristics of a good algorithm. CHAPTER 5
GETTING STARTED WITHPYTHON
Multiple Choice Questions
1. Is Python case sensitive when dealing with identifiers?
a) yes b) no
c)machine dependent d) none of the mentioned
2. What is a program in computer science?
a) A set of machine language instructions
b) A collection of hardware components
c) An ordered set of instructions to be executed by a computer
d) A high-level language
3. Which of the following is invalid?
a) _a = 1 b) __a = 1
c)__str__ = 1 d) none of the mentioned
4. Which language is called machine language?
a) Python b) C++
c) Assembly d) 0s and 1s
5. What is source code?
a) Machine language code b) High-level language code
c) Assembly language code d) Hardware description
6. Which of the following uses an interpreter?
a) C++ b) Assembly
c) Python d) Machine language
7. Which quote is attributed to Donald Knuth in the textbook?
a) “Programming is fun.” b) “Computer programming is an art.”
c) “Machines are powerful.” d) “High-level languages are easy.”
8. Which of the following is NOT a feature of Python?
a) High-level language b) Case-sensitive
c) Platform-dependent d) Rich library of predefined functions
9. What is the symbol for the Python prompt in interactive mode?
a) $ b) %
c) & d) >>>
10. What is the extension of Python source code files?
a) .java b) .py
c) .exe d) .txt 11. Which mode in Python allows the execution of individual statements
instantaneously?
a) Script mode b) Interactive mode
c) Batch mode d) Compiled mode
12. Which of the following is a Python keyword?
a) print b) import
c) function d) main
13. Which of the following is a valid identifier in Python?
a) 123abc b) abc123
c) a!bc d) None of these
14. What is a variable in Python?
a) A reserved word b) A function
c) An object uniquely identified by a name d) A type of operator
15. Which symbol is used for comments in Python?
a) // b) #
c) @ d) &
16. In Python, everything is treated as ………
a) Variable b) Function
c) Object d) Keyword
17. Which function returns the identity of an object in Python?
a) id() b) identity()
c) object_id() d) get_id()
18. What are the two execution modes in Python?
a) Compiled and Interpreted b) Interactive and Script
c) Synchronous and Asynchronous d) Batch and Real-time
19. Which of the following is NOT a feature of Python?
a) Free and open source b) Case-sensitive
c) Platform-independent d) Requires a compiler
20. Which of the following is NOT a keyword in Python?
a) while b) assert
c) print d) pass
21. What is the output of the following Python code: ‘print(“Hello, World!”)‘?
a) Hello, World! b) “Hello, World!”
c) print(“Hello, World!”) d) Syntax Error
22. Which of the following statements is true about Python?
a) Python is a low-level language.
b) Python is case-sensitive.
c) Python cannot be used for web development.
d) All these. 23. What is the correct syntax for a single-line comment in Python?
a) // This is a comment b) /* This is a comment */
c) # This is a comment d) < This is a comment >
24. Which of the following is NOT a Python data type?
a) Integer b) String
c) Boolean d) Character
25. How do you create a variable in Python?
a) Using the var keyword b) By simply assigning a value to it
c) Using the let keyword d) By declaring it first
26. Which of the following is used for indentation in Python?
a) Curly braces b) Parentheses
c) Tabs or spaces d) Semicolons
27. What will be the output of the following code: ‘print(2 + 3 * 4)‘?
a) 20 b) 14
c) 24 d) 12
28. Which Python function is used to get input from the user?
a) input() b) read()
c) scanf() d) get_input()
29. What does the following Python code do:
‘name = input(“Enter your name:”)‘?
a) Prints “Enter your name:”
b) Assigns the string “Enter your name:” to the variable name
c) Prompts the user to enter their name and stores it in the variable name
d) Generates a syntax error
30. Which of the following is an invalid variable name in Python?
a) var1 b) _var
c) 1var d) var_1
31. What is the output of the following code: ‘print(10 / 3)‘?
a) 3.33333 b) 3
c) 3.0 d) 10
32. Which of the following is NOT an arithmetic operator in Python?
a) + b) -
c) * d) &&
33. What is the correct way to create a string in Python?
a) string s = “Hello” b) s = ‘Hello’
c) s = Hello d) string s = ‘Hello’
34. Which of the following methods can be used to convert a string to a list in
Python?
a) list() b) split()
c) convert() d) str() 35. Which of the following is NOT a valid Python data type?
a) List b) Tuple
c) Dictionary d) Array
36. What is the output of the following code: ‘print(“Hello” + ” ” + “World”)‘?
a) Hello World b) HelloWorld
c) “Hello World” d) Hello + World
37. Which operator is used for exponentiation in Python?
a) ^ b) **
c) exp() d) pow()
38. Which of the following is a mutable data type in Python?
a) String b) Tuple
c) List d) Integer
39. What is the output of the following code: ‘print(2**3)‘?
a) 5 b) 6
c) 8 d) 9
40. Which function is used to read input from the user in Python 3.x?
a) input() b) raw_input()
c) scan() d) read()
41. Which of the following statements will create a tuple in Python?
a) t = [1, 2, 3] b) t = {1, 2, 3}
c) t = (1, 2, 3) d) t = 1, 2, 3
42. What is the output of the following code: ‘print(type([]))‘?
a) <class ‘tuple’> b) <class ‘list’>
c) <class ‘set’> d) <class ‘dict’>
43. Which of the following operators is used for string concatenation in Python?
a) + b) &
c) . d) concat()
44. What is the correct way to declare a variable in Python?
a) var x = 5 b) x := 5
c) int x = 5 d) x = 5
45. What will be the output of the following code: ‘print(10 % 3)‘?
a) 1 b) 3
c) 10 d) 0.3
46. Which method is used to remove an item from a list in Python by its value?
a) remove() b) pop()
c) delete() d) discard()
47. What is the output of the following code: ‘print(5 == 5)‘?
a) True b) False
c) Syntax Error d) 5 48. Which method can be used to convert a list into a tuple in Python?
a) tuple() b) list_to_tuple()
c) to_tuple() d) convert()
49. Which of the following is used to define a block of code in Python?
a) Indentation b) Curly braces
c) Parentheses d) Square brackets
50. Which function is used to get the type of an object in Python?
a) type() b) isinstance()
c) id() d) obj_type()
51. Assertion (A): Python is an interpreted language,
Reason(R) : Python programs are executed by an interpreter.
(a) A is true and R is correct explanation
(b) A is false and R is incorrect explanation
(c) A is true and R is incorrect explanation
(d) A is false and R is correct explanation
52. Assertion (A): Python is portable and platform dependent,
Reason(R) : Python programs can run on various operating systems and hardware
platforms.
(a) A is true and R is correct explanation
(b) A is false and R is incorrect explanation
(c) A is true and R is incorrect explanation
(d) A is false and R is correct explanation
53. Assertion (A): In python, Interactive mode allows execution of individual
statement instantaneously.
Reason(R) : This mode can be used to execute source code file.
(a) A is true and R is correct explanation
(b) A is false and R is incorrect explanation
(c) A is true and R is incorrect explanation
(d) A is false and R is correct explanation
54. Assertion (A): Variables whose values can be changed after they are created and
assigned are called mutable.
Reason(R) : It is preferred to use lists when we need a simple iterable collection of
data that may go for frequent modifications.
(a) A is true and R is correct explanation
(b) A is false and R is incorrect explanation
(c) A is true and R is incorrect explanation
(d) A is false and R is correct explanation 55. Assertion (A) : A dictionary is a mapping of keys to
values
Reason(R) : A dictionary can be created by using curly braces and colon-separated
pairs of keys and values.
(a) A is true and R is correct explanation
(b) A is false and R is incorrect explanation
(c) A is true and R is incorrect explanation
(d) A is false and R is correct explanation
56. Assertion (A): Evaluation of the expression is based on precedence of operators.
Reason(R) : Lower precedence operator is evaluated before the Higher precedence
operator.
(a) A is true and R is correct explanation
(b) A is false and R is incorrect explanation
(c) A is true and R is incorrect explanation
(d) A is false and R is correct explanation
Fill in the Blanks
1. A …………. is a reserved word carrying special meaning and purpose.
2. …………… are the user defined names for different parts of a program.
3. ……………….. are the fixed values.
4. ……………….. are the symbols that trigger some computation or action.
5. An ……………… is a legal combination of symbols that represents a value.
6. Non-executable, additional lines added to a program, are known as ……………..
7. In Python, the comments begin with ………..character.
8. Python is a …………….. sensitive language.
9. The ………………. function prints the value of a variable/expression.
10. The ………….. function gets the input from the user.
11. The input( ) function returns the read value as of ………….. type.
12. To convert an input( )'s value in integer type, …………….. function is used.
13. To convert an input( )'s value in floating-point type, ………………. function is used.
14. Boolean data type is internally treated as …………. data type.
15. Two forms of floating-point numbers are: …………… form
and …………….. notation.
16. Python's floating-point numbers have precision of ………… digits.
17. Three mutable types of Python are …….., ………. and …………..
18. The floor division of two integers yields a result of ………….. type.
19. The division of two integers yields a result of …………… type.
20. The ………….. sequence type cannot store duplicate values.
21. The ………….. datatype is like lists but is not mutable.
22. The ………… of an object gives the memory location of the object.
23. To check if two objects reference the same memory address, ………. operator is
used. 24. To use function fabs( ), ………… module should be imported.
25. To generate a random floating number in the range 0 to 100, ……………. function is
used.
26. To generate a random integer in a range, …………. or ………… function is used.
27. To generate a random number in a sequence of values where two values have a
difference a step value, ……………………………. function is used.
28. To use mean() function, ……. module is to be imported.
2-Mark Questions
1. Describe any two features of Python.
2. What are the different working modes in Python?
3. How are interactive mode and script mode different in Python?
4. What is the difference between keywords and identifiers?
5. How can you create a single-line string literal in Python?
6. What are delimiters in Python?
7. What are Boolean literals in Python? Give examples.
8. Why is the input() function used?
9. What is the difference between division operator and floor division operator?
10. Find the error in the following code and rewrite the corrected code.
a. a = 'Thank you! for visiting us! /Wishing you safe journey!'
b. a = input("enter value)
11. What is the difference between assignment operator and equality operator?
12. What is mapping data type? Explain with an example.
13. What is a programming language?
14. Define a program.
15. What is machine language?
16. What is the difference between high-level language and machine language?
17. Name any two high-level programming languages.
18. What is source code?
19. What is the role of a compiler?
20. What is the role of an interpreter?
21. Define Python as a high-level language.
22. What does it mean that Python is an interpreted language?
23. How does Python handle case sensitivity?
24. Mention any two features of Python.
25. What is the extension of a Python script file?
26. Explain the interactive mode in Python.
27. What is script mode in Python?
28. What are Python keywords?
29. Define identifiers in Python.
30. What are variables in Python?
31. How are comments added in Python? 32. What is an object in Python?
33. What is implicit conversion?
34. What is explicit conversion?
3-Marks Questions
1. Explain the process of program execution in Python using an interpreter.
2. What is the significance of the Python prompt `>>>`?
3. How can Python programs be executed in script mode?
4. Describe the use of indentation in Python.
5. How is Python useful in web development?
6. Explain the concept of 'interactive mode' with an example.
7. Python is a free and open-source language. What do you understand by this feature
of Python? Explain.
8. What are the applications of the Python language?
9. What are literals? How many types of literals are allowed in Python?
10. What are tokens? How many tokens are there in Python?
11. What are operators? How many different types of operators are available in Python?
12. Find the error(s) in the following Python statement:
a. x-=23+(a*2)
b. print("Turn number:"+3)
c. 1+1=1*1SyntaxError: cannot assign to operator
13. Describe the steps to run a Python program in script mode.
14. What are the rules for naming an identifier in Python?
15. Explain with an example how variables are declared in Python.
16. How does Python handle data types?
17. Describe the purpose of comments in a Python program.
18. Explain the significance of the `id()` function in Python.
19. Differentiate between `None` and `False` in Python keywords.
20. What is meant by 'Python is platform-independent'?
21. Describe how Python uses indentation for blocks and nested blocks.
22. Explain the term 'portable' in the context of Python.
23. What are Python libraries and why are they important?
24. Describe how to download and install Python.
25. How does Python handle errors during execution?
26. What is meant by 'Python is free and open source'?
5-MarksQuestions
1. What is Lvalue and Rvalue in Python? Explain with a suitable example.
2. What are comments in Python? How many ways are there to add comments in a
3. Discuss the differences between a compiler and an interpreter.
4. Explain the process of writing and executing a Python program from installation to
running a script. 5. Discuss the various features of Python that make it a preferred language for
beginners.
6. Explain the concept of 'everything is an object' in Python with examples.
7. Describe in detail the steps involved in writing a Python program in script mode and
running it.
8. Explain the different data types available in Python with examples.
9. Discuss the significance of Python in the context of modern programming and
software development.
10. Explain the use of comments in Python with examples and describe their importance.
11. Describe the rules for naming identifiers in Python and explain why these rules are
important.
12. Explain the concept of high-level and low-level programming languages and their
differences.
13. Discuss the use of Python in web development and provide examples of popular web
services built with Python.
14. What are the various ways to declare numeric literals?
15. What are Python literals and variables?
16. Write a program that inputs two value and display the swapped value.
17. Predict the output of the following:
a. x,y = 3,5
x, y, x = x + 1, y + 2, x + 5
print(x,y)
b. a = 1
a+ = 3
print(a)
c. name = "Uday"
print('Hello' + name)
d. a = 2
print(a>20)
e. x, y = 8, 10
print('x = ',x,'y = ',y)
x, y = y, x
print('new x = ',x,'new y = ',y)
18. Which of the following variable names are invalid? Justify.
i. try
ii. 123-password
iii. abc@123
iv. toTAL_1
v. for 19. Write the type of the following tokens:
i. for
ii. True
iii. =
iv. None
v. \n
20. Explain how Python handles memory management and the concept of object IDs.
21. Describe the process of debugging in Python and common techniques used.
22. Explain with examples the different types of operators available in Python.
23. Discuss the role of Python in education and why it is a good choice for learning
programming.
[Link] various types of errors.