Skip to main content

Beginner Python for Engineers Exam Materials - 533 Verified Questions

Page 1


Beginner Python for Engineers

Exam Materials

Course Introduction

Beginner Python for Engineers introduces students to the fundamentals of Python programming with a focus on practical applications in engineering. The course covers basic concepts such as variables, data types, control structures, functions, and file handling, while demonstrating how these tools can be used to solve typical engineering problems. Through hands-on exercises and projects, students will develop proficiency in writing and debugging Python code, analyzing data, and automating repetitive tasks relevant to various engineering disciplines. No prior programming experience is required, making this course ideal for students seeking to enhance their problem-solving skills and prepare for more advanced computational work in engineering.

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) A(n)___________ is a set of instructions that a computer follows to perform a task.

Answer: program

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

A)True

B)False

Answer: False

Q3) The disk drive is a secondary storage device that stores data by __________ encoding it onto a spinning circular disk.

A) electrically

B) magnetically

C) digitally

D) optically

Answer: B

Q4) A bit that is turned off is represented by the value -1.

A)True

B)False

Answer: False

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) The Python turtle is initially positioned in the __________ of a graphics window and it first appears,by default,to be heading __________.

A) center, up

B) top left corner, east

C) bottom left corner, down

D) center, east

Answer: D

Q2) ___________ are notes of explanation that document lines or sections of a program.

Answer: Comments

Q3) Which of the following will display 20%?

A) print(format(20, '.0%')) <enter>

B) print(format(0.2, '.0%')) <enter>

C) print(format(0.2 * 100, '.0%')) <enter>

D) print(format(0.2, '%')) <enter>

Answer: B

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

A)True

B)False

Answer: True

Page 4

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

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) 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

Q2) 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

Q3) Python uses the same symbols for the assignment operator as for the equality operator.

A)True

B)False

Answer: False

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) In order to draw an octagon with turtle graphics,you would need a loop that iterates eight times.

A)True

B)False

Q2) In Python,you would use the __________ statement to write a count-controlled loop.

Q3) A(n)__________ validation loop is sometimes called an error trap or an error handler.

Q4) A while loop is called a pretest loop because the condition is tested after the loop has had one iteration.

A)True

B)False

Q5) Which of the following is not an augmented assignment operator?

A) *=

B) /=

C) +=

D) <=

Q6) A(n)__________ is a special value that marks the end of a sequence of items.

Q7) A(n)___________ structure causes a set of statements to execute repeatedly.

Page 6

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) What will display after the following code is executed?

Def main():

Print("The answer is",magic(5))

Def magic(num):

Answer = num + 2 * 10

Return answer

Main()

A) 70

B) 25

C) 100

D) The statement will cause a syntax error.

Q2) A value-returning function is like a simple function except that when it finishes it returns a value back to the part of the program that called it.

A)True

B)False

Q3) One reason not to use global variables is that it makes a program hard to debug.

A)True

B)False

Q4) A(n)__________ chart is a visual representation of the relationships between functions.

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

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) 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

Q2) Which method could be used to strip specific characters from the end of a string?

A) estrip

B) rstrip

C) strip

D) remove

Q3) Closing a file disconnects the communication between the file and the program.

A)True

B)False

Q4) A(n)___________ file contains data that has been encoded as text,using a scheme such as ASCII.

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

A)True

B)False

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

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) The ___________ function can be used to convert a list to a tuple.

Q2) To add a descriptive label to the X and Y axes of a graph when using the matplotlib package,you need to import the labels module.

A)True

B)False

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

Q4) The sort method rearranges the elements of a list so they are in ascending or descending order.

A)True

B)False

Q5) The index of the first element in a list is 1,the index of the second element is 2,and so forth.

A)True

B)False

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

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

Q8) The __________ package is a library you can use in Python to create two-dimensional charts and graphs.

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) What are the valid indexes for the string 'New York'?

A) 0 through 7

B) 0 through 8

C) -1 through -8

D) -1 through 6

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

Q3) If the + operator is used on strings,it produces a string that is a combination of the two strings used as its operands.

A)True

B)False

Q4) What will be the value of the variable string after the following code executes?

String = 'Hello'

String += ' world!'

A) 'Hello'

B) ' world!'

C) 'Hello world!'

D) Nothing; this code is invalid

Q5) Each character in a string has a(n)__________ which specifies its position in the string.

Page 10

Q6) A(n)__________ is a span of characters that are taken from within a string.

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) Each element in a(n)__________ has two parts: a key and a value.

Q2) The difference of set1 and aet2 is a set that contains only the elements that appear in set1 but do not appear in set2.

A)True

B)False

Q3) A dictionary can include the same value several times but cannot include the same key several times.

A)True

B)False

Q4) In order to avoid KeyError exceptions,you can check whether a key is in the dictionary using the __________ operator.

A) included B) in C) isnotin

D) isin

Q5) The __________ method returns a value associated with a specific key and,if found,removes that key-value pair from the dictionary.

Q6) The __________ of two sets is a set that contains all the elements of both sets.

Q7) The built-in function,__________,returns the number of items in a set.

Page 11

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

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) The procedures that an object performs are called

A) methods

B) actions

C) modules

D) instances

Q2) What type of method provides a safe way for code outside a class to retrieve the values of attributes,without exposing the attributes in a way that could allow them to be changed by code outside the method?

A) accessor

B) mutator

C) setter

D) class

Q3) A class __________ is a set of statements that defines a class's methods and data attributes.

Q4) Which method is automatically called when you pass an object as an argument to the print function?

A) __state__

B) __obj__

C) __str__

D) __init__

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

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) New attributes and methods may be added to a subclass which makes it a(n)__________ version of the superclass.

Q2) In a UML diagram,what does the open arrowhead point to?

A) the superclass

B) the subclass

C) the object

D) a method

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

A) a superclass

B) a subclass

C) an object

D) an instance

Q4) __________ allows subclasses to have methods with the same names as methods in their superclasses.

Q5) In the following line of code,what is the name of the base class?

Class Python(Course):

A) Python

B) Course

C) Python(Course)

D) None of these

Page 13

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

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) 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

Q2) Recursive algorithms are always more concise and efficient than iterative algorithms.

A)True

B)False

Q3) When,in a recursive solution,function A calls function B which,in turn,calls function A,this is known as indirect recursion.

A)True

B)False

Q4) A recursive function must have some way to control the number of times it repeats. A)True

B)False

Q5) Usually a problem solved by recursion is reduced by making the value of one or more parameters __________ with each recursive call.

Q6) Recursive function calls are __________ efficient than loops.

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

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) To use the showinfo function,the tkinter.messagebox module must be imported.

A)True

B)False

Q2) To create a line with the create_line method of the Canvas widget,you must include four arguments that represent beginning and ending __________.

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) What are the items that appear on the graphical interface window called?

A) buttons

B) icons

C) widgets

D) graphical elements

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
Beginner Python for Engineers Exam Materials - 533 Verified Questions by Quizplus - Issuu