PYTHON PROGRAMMING QUIZ WITH ANSWERS, Quizzes of Information and Communications Technology (ICT)

6.0 PYTHON PROGRAMMING QUIZ FOR BEGINNERS

Typology: Quizzes

2024/2025

Available from 03/19/2025

MENJA.ONLINE
MENJA.ONLINE ๐Ÿ‡ฐ๐Ÿ‡ช

7 documents

1 / 3

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
PYTHON PROGRAMMING QUIZ QUESTIONS
variable
1. A _____ stores a piece of data, and gives it a specific name.
For example:
spam = 5
boolean
2. A _____ is like a light switch. It can only have two values. Just like a light
switch can only be on or off, a _____ can only be True or False
The __ sign is for comments. A comment is a line of text that Python won't
try to run as code. It's just for humans to read.
comment
3. A ____ is a line of text that Python won't try to run as code. It's just for
humans to read.
triple quotation(โ€โ€โ€)
4. The __ sign will only comment out a single line. While you could write a
multi-line comment, starting each line with __, that can be a pain.
Instead, for multi-line comments, you can include the whole block in a set of
____ _____ marks:
"""Sipping from your cup 'til it runneth over,
Holy Grail.
"""
*
in python, we use __ to indicate multiplication
**
in python, we use __ to indicate exponents.
modulo
5. ____ returns the remainder from a division. So, if you type 3 % 2, it will
return 1, because 2 goes into 3 evenly once, with 1 left over.
%
a modulo is represented by what between numbers?
pf3

Partial preview of the text

Download PYTHON PROGRAMMING QUIZ WITH ANSWERS and more Quizzes Information and Communications Technology (ICT) in PDF only on Docsity!

PYTHON PROGRAMMING QUIZ QUESTIONS

variable

  1. A _____ stores a piece of data, and gives it a specific name. For example: spam = 5 boolean
  2. A _____ is like a light switch. It can only have two values. Just like a light switch can only be on or off, a _____ can only be True or False The __ sign is for comments. A comment is a line of text that Python won't try to run as code. It's just for humans to read. comment
  3. A ____ is a line of text that Python won't try to run as code. It's just for humans to read. triple quotation(โ€โ€โ€)
  4. The __ sign will only comment out a single line. While you could write a multi-line comment, starting each line with __, that can be a pain. Instead, for multi-line comments, you can include the whole block in a set of ____ _____ marks: """Sipping from your cup 'til it runneth over, Holy Grail. """
    in python, we use __ to indicate multiplication
    in python, we use __ to indicate exponents. modulo
  5. ____ returns the remainder from a division. So, if you type 3 % 2, it will return 1, because 2 goes into 3 evenly once, with 1 left over. % a modulo is represented by what between numbers?

string

  1. Another useful data type is the ____. A ____ can contain letters, numbers, and symbols. quotes
  2. The thing that separates strings from variables is that string needs to be in ____. backslash
  3. There are some characters that cause problems. For example: 'There's a snake in my boot!' This code breaks because Python thinks the apostrophe in 'There's' ends the string. We can use the _____ to fix the problem, like this: 'There's a snake in my boot!' index
  4. Each character in a string is assigned a number. This number is called the _____. number 10.Each character in a string is assigned a ____. This number is called the index. string 11.Each character in a ____ is assigned a number. This number is called the index. 0 instead of 1 12.In Python, we start counting the index from ___ instead of __ index what is this an example of: c = "cats"[0] n = "Ryan"[3] string methods 13. ___ ____ let you perform specific tasks for strings. We'll focus on four string methods: