Python Programming Basics

Test your knowledge of fundamental Python programming concepts including variables, functions, selection statements, iteration, errors, and algorithms.

13 Questions Published

Questions

Question 1 Multiple Choice (Single Answer)

Comments in code are used....

  1. To explain the code
  2. To ask the coder how he/she is doing
  3. To make the code work
  4. To avoid a syntax error
Question 2 Multiple Choice (Single Answer)

In computer programming, what is a variable ?

  1. Not consistent or having a fixed pattern; liable to change
  2. Somewhere to store functions
  3. Names used to store one or morevalues e.g. a users ages
  4. A symbol that represents a quantity
Question 3 Multiple Choice (Single Answer)

A small section of a program that performs a specific task repeatedly, e.g. displaying results

  1. Compilers
  2. Procedures
  3. Functions
  4. Modules
Question 4 Multiple Choice (Single Answer)

What is the name given to the keywords that perform specific tasks (examples: "print" "input")?

  1. Selections
  2. Debuggers
  3. Functions
  4. Procedures
Question 5 Multiple Choice (Single Answer)

This type of error occurs when the logic used to code the program failed to solve the problem

  1. Syntax
  2. Logic
Question 6 Multiple Choice (Single Answer)

This type of error occurs when the code is not formatted or typed correctly

  1. Syntax
  2. Logic
Question 7 Multiple Choice (Single Answer)

This symbol is used when you want to add comments to your code

  1. #
  2. &
  3. $
  4. *
Question 8 Multiple Choice (Single Answer)

This is useful for planning and writing algorithms, half english, half code.

  1. Debugger
  2. Algorithm
  3. Psuedocode
  4. Script
Question 9 Multiple Choice (Single Answer)

What is a logical sequence of steps that follow in solving a problem referred to as?

  1. Plan
  2. Instructions
  3. Pseudocode
  4. Algorithm
Question 10 Multiple Choice (Single Answer)

if, else and elif are what type of statements?

  1. Loops
  2. Selection
  3. Iteration
  4. Procudure
Question 11 Multiple Choice (Single Answer)

Which statement is used for iteration?

  1. if
  2. while
  3. when
  4. elif
Question 12 Multiple Choice (Single Answer)

What is iteration?

  1. A process of looping or repeating sections of a program
  2. A process of fixing a program
  3. A program that uses selection
  4. A program that performs bug checks continuously