Unit 1: Introduction; Variables, Expressions and Statements - Subjective Questions

ECE181 — Introduction To Python • Practice Questions with Detailed Answers

20 questions

1

Explain the need for a programming language. Why can't computers be instructed directly in natural human language?

2

Introduce Python as a programming language. Discuss its key features that make it popular.

3

Describe the different types of programming errors. Explain the process of debugging.

4

What are identifiers in Python? State the rules for naming identifiers with examples.

5

Define a variable. Explain how variables are created and used in Python with suitable examples.

6

Explain assignment statements in Python. Discuss chained and simultaneous assignment with examples.

7

What is an expression in Python? Distinguish between an expression and a statement.

8

What is a named constant? How are constants represented in Python? Explain with examples.

9

Describe the numeric data types available in Python with examples.

10

Explain the boolean data type in Python. How are boolean values produced and used?

11

Explain the various categories of operators in Python with examples.

12

Explain operator precedence and associativity in Python. Evaluate the expression step by step.

13

What are augmented assignment operators? List them and explain their use with examples.

14

Explain type conversion in Python. Distinguish between implicit and explicit type conversion with examples.

15

Explain the concept of rounding in Python. How does the round() function work? Discuss with examples.

16

Distinguish between / (true division), // (floor division), and % (modulus) operators with examples.

17

Explain the logical operators (and, or, not) in Python and the concept of short-circuit evaluation.

18

Write short notes on the structure of a Python program and explain how the interpreter processes statements. Include comments and indentation.

19

Given the expressions below, evaluate each and explain the result: (a) 7 // 2 + 3 ** 2, (b) 10 % 4 * 2, (c) 2 + 3 > 4 and 5 < 2, (d) int("12") + float("3.5").

20

Compare compiled and interpreted languages. Explain why Python is called an interpreted language and discuss its advantages and disadvantages.