Beginning Python Solved Exam Questions - 533 Verified Questions

Page 1


Beginning Python Solved Exam Questions

Course Introduction

Beginning Python introduces students to the fundamentals of programming using the Python language, one of the most popular and versatile languages in software development today. This course covers essential programming concepts such as variables, data types, control structures, functions, and error handling, with a focus on practical problem-solving techniques. Students will learn how to write, debug, and execute simple Python programs, develop algorithms, and apply their skills to real-world examples, laying a strong foundation for more advanced programming courses and applications. No prior experience with programming is required.

Recommended Textbook

Starting Out with Python 4th Edition by Tony Gaddis

Available Study Resources on Quizplus

13 Chapters

533 Verified Questions

533 Flashcards

Source URL: https://quizplus.com/study-set/2419

Page 2

Chapter 1: Introduction to Computers and Programming

Available Study Resources on Quizplus for this Chatper

39 Verified Questions

39 Flashcards

Source URL: https://quizplus.com/quiz/48072

Sample Questions

Q1) Which computer language uses short words known as mnemonics for writing programs?

A) Assembly

B) Java

C) Pascal

D) Visual Basic

Answer: A

Q2) A computer is a single device that performs different types of tasks for its users.

A)True

B)False

Answer: False

Q3) What type of volatile memory is usually used only for temporary storage while running a program?

A) ROM

B) TMM

C) RAM

D) TVM

Answer: C

To view all questions and flashcards with answers, click on the resource link above. Page 3

Chapter 2: Input, Processing, and Output

Available Study Resources on Quizplus for this Chatper

40 Verified Questions

40 Flashcards

Source URL: https://quizplus.com/quiz/48073

Sample Questions

Q1) After the execution of the following statement,the variable sold will reference the numeric literal value as (n)__________ data type.

Sold = 256.752

A) int

B) float

C) str

D) currency

Answer: B

Q2) In Python,print statements written on separate lines do not necessarily output on separate lines.

A)True

B)False

Answer: True

Q3) The % symbol is the remainder operator,also known as the ___________ operator. Answer: modulus,mod

Q4) A flowchart is a tool used by programmers to design programs.

A)True

B)False

Answer: True

To view all questions and flashcards with answers, click on the resource link above. Page 4

Chapter 3: Decision Structures and Boolean Logic

Available Study Resources on Quizplus for this Chatper

40 Verified Questions

40 Flashcards

Source URL: https://quizplus.com/quiz/48074

Sample Questions

Q1) The Python language is not sensitive to block structuring of code.

A)True

B)False

Answer: False

Q2) What does the following expression mean?

X <= y

A) x is less than y

B) x is less than or equal to y

C) x is greater than y

D) x is greater than or equal to y

Answer: B

Q3) A(n)__________ structure is a logical design that controls the order in which a set of statements execute.

A) function

B) control

C) sequence

D) iteration

Answer: B

Q4) In flowcharting,the __________ symbol is used to represent a Boolean expression.

Answer: diamond

To view all questions and flashcards with answers, click on the resource link above. Page 5

Chapter 4: Repetition Structures

Available Study Resources on Quizplus for this Chatper

41 Verified Questions

41 Flashcards

Source URL: https://quizplus.com/quiz/48075

Sample Questions

Q1) The integrity of a program's output is only as good as the integrity of its input. For this reason,the program should discard input that is invalid and prompt the user to enter valid data.

A)True

B)False

Q2) What type of loop structure repeats the code based on the value of Boolean expression?

A) condition-controlled loop

B) number-controlled loop

C) count-controlled loop

D) Boolean-controlled loop

Q3) To get the total number of iterations in a nested loop,add the number of iterations in the inner loop to the number in the outer loop.

A)True

B)False

Q4) The first line in a while loop is referred to as the condition clause.

A)True

B)False

To view all questions and flashcards with answers, click on the resource link above.

Chapter 5: Functions

Available Study Resources on Quizplus for this Chatper

66 Verified Questions

66 Flashcards

Source URL: https://quizplus.com/quiz/48076

Sample Questions

Q1) In a value-returning function,the value of the expression that follows the keyword __________ will be sent back to the part of the program that called the function.

A) def

B) result

C) sent

D) return

Q2) In Python,a module's file name should end in ___________.

Q3) The __________ design technique can be used to break down an algorithm into functions.

A) subtask

B) block

C) top-down

D) simplification

Q4) The function header begins with the keyword __________ and is followed by the name of the function.

Q5) In a flowchart,a function call is depicted by a(n)___________.

Q6) The value assigned to a global constant can be changed in the mainline logic. A)True

B)False

Page 7

To view all questions and flashcards with answers, click on the resource link above.

Chapter 6: Files and Exceptions

Available Study Resources on Quizplus for this Chatper

40 Verified Questions

40 Flashcards

Source URL: https://quizplus.com/quiz/48077

Sample Questions

Q1) Programmers usually refer to the process of __________ data in a file as writing data to the file.

Q2) Which statement can be used to handle some of the runtime errors in a program?

A) an exception statement

B) a try statement

C) a try/except statement

D) an exception handler statement

Q3) A filename __________ is a short sequence of characters that appear at the end of a filename,preceded by a period.

Q4) Which step creates a connection between a file and a program?

A) open the file

B) read the file

C) process the file

D) close the file

Q5) When a piece of data is read from a file,it is copied from the file into the program.

A)True

B)False

Q6) If data is retrieved from a file by a program,this is known by the term __________ file.

8

To view all questions and flashcards with answers, click on the resource link above.

Chapter 7: Lists and Tuples

Available Study Resources on Quizplus for this Chatper

40 Verified Questions

40 Flashcards

Source URL: https://quizplus.com/quiz/48078

Sample Questions

Q1) In order to create a graph in Python,you need to include

A) import matplotlib

B) import pyplot

C) import matplotlib.pyplot

D) import matplotlib

Import pyplot

Q2) Which method can be used to convert a tuple to a list?

A) append

B) tuple

C) insert

D) list

Q3) The __________ function returns the item that has the lowest value in the sequence.

Q4) The primary difference between a tuple and a list is that

A) you don't use commas to separate elements in a tuple

B) a tuple can only include string elements

C) a tuple cannot include lists as elements

D) once a tuple is created, it cannot be changed

Q5) The __________ method is commonly used to add items to a list.

Q6) A(n)__________ is an object that holds multiple items of data.

To view all questions and flashcards with answers, click on the resource link above. Page 9

Chapter 8: More About Strings

Available Study Resources on Quizplus for this Chatper

37 Verified Questions

37 Flashcards

Source URL: https://quizplus.com/quiz/48079

Sample Questions

Q1) The __________ method returns True if the string contains only numeric digits.

Q2) What is the first negative index in a string?

A) 0

B) -1

C) -0

D) the size of the string minus one

Q3) The following code will display 'yes + no':

mystr = 'yes'

yourstr = 'no'

mystr += yourstr

print(mystr)

A)True

B)False

Q4) The isalpha()method returns __________ if the string contains only alphabetic characters and is at least one character in length.

A)True

B)False

Q5) The __________ method returns the list of the words in a string.

Q6) The __________ method returns a copy of the string with all the alphabetic letters converted to lower case.

Page 10

To view all questions and flashcards with answers, click on the resource link above.

Chapter 9: Dictionaries and Sets

Available Study Resources on Quizplus for this Chatper

39 Verified Questions

39 Flashcards

Source URL: https://quizplus.com/quiz/48080

Sample Questions

Q1) What is the value of the variable phones after the following code executes?

Phones = {'John' : '5555555','Julie' : '5557777'}

Phones['John'] = 5556666'

A) {'John' : '5555555', 'Julie' : '5557777'}

B) {'John' : '5556666', 'Julie' : '5557777'}

C) {'John' : '5556666'}

D) This code is invalid.

Q2) What will be the result of the following code?

Ages = {'Aaron' : 6,'Kelly' : 3,'Abigail' : 1 }

Value = ages['Brianna']

A) False

B) -1

C) 0

D) KeyError

Q3) In a dictionary,you use a(n)__________ to locate a specific value.

A) datum

B) element

C) item

D) key

Q4) The __________ method returns all of a dictionary's keys as a dictionary view.

To view all questions and flashcards with answers, click on the resource link above. Page 11

Chapter 10: Classes and Object-Oriented Programming

Available Study Resources on Quizplus for this Chatper

38 Verified Questions

38 Flashcards

Source URL: https://quizplus.com/quiz/48081

Sample Questions

Q1) In object-oriented programming,one of first tasks of the programmer is to

A) list the nouns in the problem

B) list the methods that are needed

C) identify the classes needed

D) identify the objects needed

Q2) ___________ provides a set of standard diagrams for graphically depicting object-oriented systems.

Q3) A class can be thought of as a blueprint that can be used to create an object.

A)True

B)False

Q4) Which attributes belong to a specific instance of a class?

A) instance

B) self

C) object

D) data

Q5) An object is a stand-alone program but is used by programs that need its service.

A)True

B)False

Q6) A(n)__________ method in a class initializes an object's data attributes.

Page 12

To view all questions and flashcards with answers, click on the resource link above.

Chapter 11: Inheritance

Available Study Resources on Quizplus for this Chatper

36 Verified Questions

36 Flashcards

Source URL: https://quizplus.com/quiz/48082

Sample Questions

Q1) What gives a program the ability to call the correct method depending on the type of object that is used to call it?

A) Polymorphism

B) Inheritance

C) Encapsulation

D) Methods

Q2) Which of the following is the correct syntax for defining a class,table,which inherits from the furniture class?

A) class furniture[table]:

B) class table.furniture:

C) class furniture(table):

D) class table(furniture):

Q3) New attributes and methods may be added to a subclass.

A)True

B)False

Q4) In an inheritance relationship,what is a specialized class called?

A) a superclass

B) a subclass

C) an object

D) an instance

To view all questions and flashcards with answers, click on the resource link above. Page 13

Chapter 12: Recursion

Available Study Resources on Quizplus for this Chatper

35 Verified Questions

35 Flashcards

Source URL: https://quizplus.com/quiz/48083

Sample Questions

Q1) In many cases it is easier to see how to solve a problem with recursion than with a loop.

A)True

B)False

Q2) Recursive function calls are __________ efficient than loops.

Q3) What defines the depth of recursion?

A) the length of the algorithm

B) the number of function calls

C) the number of times the function calls itself

D) the number of times the function goes to the base case

Q4) Each time a function is called in a recursive solution,the system incurs overhead that is not incurred with a loop.

A)True

B)False

Q5) Which of the following describes the base case in a recursive solution?

A) a case in which the problem can be solved without recursion

B) the case in which the problem is solved through recursion

C) the way to stop the recursion

D) the way to return to the main function

Q6) Some problems are more __________ solved with recursion than with a loop.

Page 14

To view all questions and flashcards with answers, click on the resource link above.

Chapter 13: Gui Programming

Available Study Resources on Quizplus for this Chatper

42 Verified Questions

42 Flashcards

Source URL: https://quizplus.com/quiz/48084

Sample Questions

Q1) A __________ is a container that can be used to organize the widgets in a window.

A) Textbox

B) Label

C) Frame

D) Canvas

Q2) Radio buttons can be used to allow the user to make multiple selections at one time.

A)True

B)False

Q3) In an event-driven program,the __________ accepts the user's commands.

A) register

B) CPU

C) operating system

D) GUI

Q4) An info dialog box is a window that displays a message to the user and has an OK button which,when clicked,closes the dialog box.

A)True

B)False

Q5) The __________ module allows you to create GUI programs in Python.

To view all questions and flashcards with answers, click on the resource link above. Page 15

Turn static files into dynamic content formats.

Create a flipbook