0% found this document useful (0 votes)
2 views2 pages

Python Basics Activity

The document contains a series of questions related to Python programming concepts, including definitions of key terms such as variables, input, processing, output, and operators. It also explores the importance of variables, the validity of variable names, and the identification of input, processing, and output in a given program. Additionally, it discusses arithmetic and comparison operators, their usage, and examples.

Uploaded by

esonaswapi
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views2 pages

Python Basics Activity

The document contains a series of questions related to Python programming concepts, including definitions of key terms such as variables, input, processing, output, and operators. It also explores the importance of variables, the validity of variable names, and the identification of input, processing, and output in a given program. Additionally, it discusses arithmetic and comparison operators, their usage, and examples.

Uploaded by

esonaswapi
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

QUESTION 1 - DEFINITIONS [10 marks]

Define EACH of the following terms as used in Python programming. (2 marks each)

1.1 Variable

1.2 Input

1.3 Processing

1.4 Output

1.5 Operator

QUESTION 2 - WHY USE A VARIABLE? [6 marks]

2.1 Explain why a programmer would use a variable instead of typing an actual value

directly into the code. (3)

2.2 Using a short example, show how a variable's value can be reused and then updated

later in the same program. (3)

QUESTION 3 - IS THIS A VALID VARIABLE NAME? [8 marks]

For EACH of the following, state whether it is a VALID or INVALID Python variable name, and

give a reason for your answer. (2 marks each: 1 mark for valid/invalid, 1 mark for a correct

reason)

3.1 2total

3.2 student_name

3.3 class

3.4 first name


QUESTION 4 - IDENTIFY IPO [8 marks]

Study the program below, then answer the questions that follow.

name = input("Enter your name: ")

price = float(input("Enter the price of the item: "))

discount = price * 0.10

final_price = price - discount

print("Hello", name, "your discounted price is R", final_price)

4.1 Write down ONE line of code that represents Input. (2)

4.2 Write down ONE line of code that represents Processing. (2)

4.3 Write down ONE line of code that represents Output. (2)

4.4 In ONE sentence, state the overall purpose of this program. (2)

QUESTION 5 - LIST AND EXPLAIN ARITHMETIC OPERATORS [10 marks]

List FIVE arithmetic operators used in Python. For EACH one, give its symbol, its name, and a

short example showing how it is used. (2 marks each)

QUESTION 6 - COMPARING OPERATORS [8 marks]

6.1 Explain the difference between a relational (comparison) operator and a logical

operator. (4)

6.2 Write ONE example of a condition that uses a relational operator AND a logical operator

together (e.g. inside an if statement). (4)

You might also like