Grade 12 results are out. Where to check yours

Unit notes and practice questions

Grade 11 Information Technology unit 6: Fundamentals of Programming

Everything here is for unit 6 of the Grade 11 Information Technology textbook: what the chapter covers, the short notes, practice questions with their answers, and the lesson video where one exists.

Get it on Google Play
3
Cards
10
Practice questions on unit 6

What unit 6 covers

  1. 1.Types of Programming Languages
  2. 2.Basics of Python
  3. 3.Variables and Data Types
  4. 4.Statements and Expressions
  5. 5.Writing a Simple Program

Short notes for unit 6

The cards filed under this chapter on the Grade 11 Information Technology page. Open one at a time.

When you use it

Use when creating variable names and checking if an identifier is valid in Python.

Watch out

Variable names cannot start with a digit, cannot contain special characters like & or *, and cannot be Python keywords like while or if.

Drafted from Grade 11 Information Communication Technology, page 132 onwards, then checked twice before it went up

When you use it

Use to distinguish between program grammatical violations and incorrect computational results.

Watch out

Compilers and interpreters automatically detect syntax errors and stop execution, but logic errors do not generate error messages and must be found by checking program output.

Drafted from Grade 11 Information Communication Technology, page 132 onwards, then checked twice before it went up

When you use it

Reach for this when reading numerical user input from the keyboard in Python.

Watch out

The input() function always returns a string (str), so performing arithmetic on it without explicit conversion using int() or float() causes a runtime TypeError.

Drafted from Grade 11 Information Communication Technology, page 132 onwards, then checked twice before it went up

Practice questions on unit 6

10 multiple-choice questions written against this chapter, each with its answer and the reason. Try one before you open the answer.

Question 1

In machine language, which symbols are used to represent instructions, numbers and memory locations?

  1. A.1s and 0s (the binary system)
  2. B.Mnemonics such as ADD and MOV
  3. C.English words
  4. D.Decimal digits from 0 to 9
Show the answer and why

Answer: A 1s and 0s (the binary system)

Why

Machine language is a low-level language. Everything in it is written with 1s and 0s, which is the binary system. Mnemonics are used in assembly language, not machine language.

Question 2

Which software translates assembly language instructions into machine language?

  1. A.Interpreter
  2. B.Compiler
  3. C.Assembler
  4. D.IDLE
Show the answer and why

Answer: C Assembler

Why

The textbook says the software that translates assembly language into machine language is called an Assembler. A compiler and an interpreter translate high-level languages, not assembly language.

Question 3

What does the name IDLE stand for, as used with Python?

  1. A.Integrated Development and Learning Environment
  2. B.Interactive Data Language Editor
  3. C.Internal Desktop Logic Engine
  4. D.Integrated Design and Linking Environment
Show the answer and why

Answer: A Integrated Development and Learning Environment

Why

IDLE stands for Integrated Development and Learning Environment. It is the free environment that comes with Python.

Question 4

A Python script is saved in a file. Which file extension must the script file have?

  1. A..txt
  2. B..py
  3. C..exe
  4. D..doc
Show the answer and why

Answer: B .py

Why

The textbook says a file that keeps Python scripts is saved with the .py extension. This is called a script file.

Question 5

Which of these languages uses an interpreter to translate its programs?

  1. A.C
  2. B.Java
  3. C.Python
  4. D.C#
Show the answer and why

Answer: C Python

Why

C, Java and C# use compilers. Python, Perl and Ruby use interpreters. An interpreter translates and runs a program one statement at a time.

Question 6

A student writes this line to find the area of a circle: area=PI*radius*2. Python runs the program with no error message, but the answer is wrong. What kind of error is this?

  1. A.Syntax error
  2. B.Logic error
  3. C.Identifier error
  4. D.Assembly error
Show the answer and why

Answer: B Logic error

Why

The program has no syntax error because it follows the rules of the language. It is a logic error because the formula is wrong. The correct formula is area=PI*radius**2. Interpreters and compilers do not catch logic errors.

Question 7

Which of these is a valid identifier in Python?

  1. A.1x
  2. B.*_5
  3. C.while
  4. D.area_5
Show the answer and why

Answer: D area_5

Why

An identifier must start with a letter or an underscore, and the other characters must be letters, numbers or underscores. area_5 follows these rules. 1x starts with a number, *_5 starts with a character that is not allowed, and while is a keyword.

Question 8

Which of these is an expression, not a statement?

  1. A.x=5
  2. B.print(x)
  3. C.y=x
  4. D.x+5
Show the answer and why

Answer: D x+5

Why

An expression is something the interpreter evaluates to produce a value. x+5 is a complex expression. x=5, y=x and print(x) are statements, because they are instructions the interpreter carries out.

Question 9

Which expression gives the result 2?

  1. A.5/2
  2. B.5//2
  3. C.5%2
  4. D.2**5
Show the answer and why

Answer: B 5//2

Why

The floor division operator // returns only the integer part of the quotient, so 5//2 gives 2. The division operator / gives 2.5. The modulus operator % returns the remainder, which is 1. The exponentiation operator ** gives 32.

Question 10

Look at this code:

x=5
y=2.5
z=x+y

What is the data type of z?

  1. A.int
  2. B.float
  3. C.str
  4. D.bool
Show the answer and why

Answer: B float

Why

Here x is an int and y is a float. Python does the conversion itself, which is called implicit conversion. It converts the smaller type (int) to the larger type (float) so that no data is lost. So z is a float, with the value 7.5.

The app holds 12 questions on this unit, marked as you go. These are the first 10.

The textbook pages for unit 6

The whole Grade 11 Information Technology textbook, free as a PDF.

Ministry of Education edition, English, 170 pages

Download the PDF

Practise this unit in the app

Temari turns this chapter into timed practice and marks it as you go, with an AI tutor to explain anything that did not land.

Start free

Temari.et is also an Android app, free on Google Play.

Sign inCreate your account