PYTHON PROGRAMMING FINAL EXAM QUESTIONS WITH ANSWERS #9, Exams of Computer Science

PYTHON PROGRAMMING FINAL EXAM QUESTIONS WITH ANSWERS #9

Typology: Exams

2025/2026

Available from 02/09/2026

YourExamPlug
YourExamPlug 🇿🇦

1.4K documents

1 / 3

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
PYTHON PROGRAMMING FINAL EXAM QUESTIONS WITH
ANSWERS #9
Name three kinds of sequences - correct answer list
Tuple
String
A _________________ loop is used to iterate through a sequence - correct answer for
The ____________________ function is used to determine how many pairs in a
dictionary or how many elements in a sequence - correct answer len()
An if statement is built by using if followed by a _________________, a
__________________, and a ___________________ of one or more statements -
correct answer condition
Colon
Block
Name the three things that must occur for a sentry variable to effectively control the
while loop - correct answer initialize
Check
Change
Assignment statements take what's on the ___________ and assign it to the variable on
the ___________ - correct answer right
Left
To print quotes inside a string, use an ___________________ to make python ignore
them. They can also be used to print tabs - correct answer escape sequence
What are the three types of errors? - correct answer syntax
Runtime
Logic
A __________________ can be described simply as a mini-program - correct answer
function
The import statement allows the programmer to import a ___________________ which
contains code that can be used in any python program - correct answer module
Dictionaries consist of pairs of ________________ and _______________ - correct
answer keys
Values
pf3

Partial preview of the text

Download PYTHON PROGRAMMING FINAL EXAM QUESTIONS WITH ANSWERS #9 and more Exams Computer Science in PDF only on Docsity!

PYTHON PROGRAMMING FINAL EXAM QUESTIONS WITH

ANSWERS

Name three kinds of sequences - correct answer list Tuple String A _________________ loop is used to iterate through a sequence - correct answer for The ____________________ function is used to determine how many pairs in a dictionary or how many elements in a sequence - correct answer len() An if statement is built by using if followed by a _________________, a __________________, and a ___________________ of one or more statements - correct answer condition Colon Block Name the three things that must occur for a sentry variable to effectively control the while loop - correct answer initialize Check Change Assignment statements take what's on the ___________ and assign it to the variable on the ___________ - correct answer right Left To print quotes inside a string, use an ___________________ to make python ignore them. They can also be used to print tabs - correct answer escape sequence What are the three types of errors? - correct answer syntax Runtime Logic A __________________ can be described simply as a mini-program - correct answer function The import statement allows the programmer to import a ___________________ which contains code that can be used in any python program - correct answer module Dictionaries consist of pairs of ________________ and _______________ - correct answer keys Values

____________________ is used to create visual and logical blocks of code - correct answer indentation When one or more ___________________ are added to the if statement, a sequence of conditions can be evaluated - correct answer elifs While the condition of a loop is ___________________ , the ___________________ executed - correct answer true Block And, or, and not are examples of _______________ operators - correct answer boolean Use the _______________ method to take an item out of a list based on its value - correct answer remove All sequences start at index __________ - correct answer 0 Strings can contain only characters, but tuples and lists can contain ___________________ type - correct answer any ___________________ allows you to specify a position number in a string or tuple and access the element in that position - correct answer indexing ___________________ are variables that aren't supposed to change; they are usually all uppercase - correct answer constants Just like strings, tuples and lists can be ___________________ using the '+' sign - correct answer concatenated You must use the _________________ method to put a new value onto the end of a list

  • correct answer append Which data type(s) are immutable? - correct answer string Tuple Which data type(s) use the numbers starting with 0 as indices? - correct answer string List Tuple Which data type(s) use keys to access values? - correct answer dictionary Which data type(s) can be sliced? - correct answer string List Tuple