0% found this document useful (0 votes)
11 views17 pages

Programming Fundamentals MCQ PDF

Programming Fundamentals MCQ PDF available on Quizplus.com. The resource URL is https://quizplus.com/study-set/895-starting-out-with-python

Uploaded by

74akitvcpd
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views17 pages

Programming Fundamentals MCQ PDF

Programming Fundamentals MCQ PDF available on Quizplus.com. The resource URL is https://quizplus.com/study-set/895-starting-out-with-python

Uploaded by

74akitvcpd
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 17

Programming Fundamentals

MCQ PDF

https://quizplus.com/study-set/895
14 Chapters
489 Verified Questions
Programming Fundamentals
MCQ PDF
Cou
Programming Fundamentals is an introductory course designed to provide students with

a foundational understanding of computer programming concepts and

problem-solving techniques. The course covers essential topics such as algorithms,

variables, data types, control structures (including conditionals and loops), functions,

arrays, and basic input/output operations. Students will learn to write, debug, and test

simple programs, typically using a high-level programming language. Emphasis is

placed on logical thinking and developing effective coding practices, preparing students

for more advanced studies in computer science and software development.

Recommended Textbook
Starting Out with Python 2nd Edition by Tony Gaddis

Available Study Resources on Quizplus


14 Chapters
489 Verified Questions
489 Flashcards
Source URL: https://quizplus.com/study-set/895

Page 2
Chapter 1: Introduction to Computers and Programming
Available Study Resources on Quizplus for this Chatper
35 Verified Questions
35 Flashcards
Source URL: https://quizplus.com/quiz/17656

Sample Questions
Q1) 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

Q2) The Python language uses a compiler, which is a program that both translates and
executes the instructions in a high level language.
A)True
B)False
Answer: False

Q3) Which language from the following list is referred to as a low-level language?
A) C++
B) Assembly language
C) JAVA
D) Python
Answer: B

Q4) _______________ are small central processing unit chips.


Answer: Microprocessors

To view all questions and flashcards with Page 3 click on the resource link above.
answers,
Chapter 2: Input, Processing, and Output
Available Study Resources on Quizplus for this Chatper
35 Verified Questions
35 Flashcards
Source URL: https://quizplus.com/quiz/17657

Sample Questions
Q1) The output of the following print statement is: print 'I\'m ready to begin'
A) Im ready to begin
B) I\'m ready to begin
C) I'm ready to begin
D) 'I\'m ready to begin'
Answer: C

Q2) What is the output of the following print statement? print('The path is
D:\\sample\\test.')
A) 'The path is D:\\sample\\test.'
B) The path is D:\\sample\\test.
C) The path is D\\sample\\test.
D) The path is D:\sample\test.
Answer: D

Q3) When the + operator is used with two strings, it performs string
_______________.
Answer: concatenation

Q4) Python allows programmers to break a statement into multiple lines.


A)True
B)False
Answer: True

To view all questions and flashcards with Page 4 click on the resource link above.
answers,
Chapter 3: Simple functions
Available Study Resources on Quizplus for this Chatper
34 Verified Questions
34 Flashcards
Source URL: https://quizplus.com/quiz/17658

Sample Questions
Q1) A local variable can be accessed from anywhere in the program.
A)True
B)False
Answer: False

Q2) The _____ argument specifies which parameter the argument should be passed
into.
A) keyword
B) local
C) global
D) string
Answer: A

Q3) Python allows for passing multiple arguments to a function.


A)True
B)False
Answer: True

Q4) The function header begins with the keyword _______________ followed by the
name of the function.
Answer: def

Q5) A variable is visible only to statements in the variable's _______________.


Answer: scope
Page 5
To view all questions and flashcards with answers, click on the resource link above.
Chapter 4: Decision Structures and Boolean Logic
Available Study Resources on Quizplus for this Chatper
35 Verified Questions
35 Flashcards
Source URL: https://quizplus.com/quiz/17659

Sample Questions
Q1) A(n) _______________ statement will execute one block of statements if its
condition ist, or another block if its condition is false.

Q2) Short-circuit evaluation is performed with the not operator.


A)True
B)False

Q3) When using the _____ operator, both subexpressions must bet for the compound
expression to bet.
A) or
B) and
C) not
D) maybe

Q4) In Python, the _____ symbol is used as the not-equal-to operator.


A) ==
B) <>
C) <=
D) !=

Q5) A(n) _______________ operator determines whether a specific relationship


exists between two values.

Q6) A(n) _______________ expression is made up of two or more Boolean


expressions. Page 6

To view all questions and flashcards with answers, click on the resource link above.
Chapter 5: Repetition Structures
Available Study Resources on Quizplus for this Chatper
35 Verified Questions
35 Flashcards
Source URL: https://quizplus.com/quiz/17660

Sample Questions
Q1) A(n) _______________ total is a sum of numbers that accumulates with each
iteration of a loop.

Q2) In Python, the variable in the for clause is referred to as the _____ because it is the
target of an assignment at the beginning of each loop iteration.
A) target variable
B) loop variable
C) for variable
D) count variable

Q3) The _______________ function is a built-in function that generates a list of


integer values.

Q4) A(n) _______________ validation loop is sometimes called an error trap or an


error handler.

Q5) In Python, an infinite loop usually occurs when the computer accesses the wrong
memory address.
A)True
B)False

Q6) A(n) _______________-controlled loop causes a statement or set of statements


to repeat as long as a condition ist.

To view all questions and flashcards with answers, click on the resource link above.
Page 7
Chapter 6: Value-Returning functions and Modules
Available Study Resources on Quizplus for this Chatper
35 Verified Questions
35 Flashcards
Source URL: https://quizplus.com/quiz/17661

Sample Questions
Q1) Python comes with _____ functions that have been already prewritten for the
programmer.
A) standard
B) library
C) custom
D) built-in

Q2) The math function, ceil(x), returns the smallest integer that is greater than or equal
to x.
A)True
B)False

Q3) The math function, atan(x), returns one tangent of x in radians.


A)True
B)False

Q4) Which of the following statements causes the interpreter to load the contents of the
random module into memory?
A) load random
B) import random
C) upload random
D) download random

Q5) The 'P' in the acronym IPO refers to _______________.


Page 8
To view all questions and flashcards with answers, click on the resource link above.
Chapter 7: files and Exceptions
Available Study Resources on Quizplus for this Chatper
35 Verified Questions
35 Flashcards
Source URL: https://quizplus.com/quiz/17662

Sample Questions
Q1) A(n) _____ access file is also known as a direct access file.
A) sequential
B) random
C) numbered
D) text

Q2) How many types of files are there?


A) One
B) Two
C) Three
D) four

Q3) When a program needs to save data for later use, it writes the data in a(n)
_______________.

Q4) If the last line in a file is not terminated with a \n, the readline method will return the
line without a \n.
A)True
B)False

Q5) A(n) _______________ includes one or more statements that can potentially
raise an exception.

Q6) A(n) _______________ file contains data that has been encoded as text, using a
scheme such as ASCII. Page 9

To view all questions and flashcards with answers, click on the resource link above.
Chapter 8: Lists and Tuples
Available Study Resources on Quizplus for this Chatper
35 Verified Questions
35 Flashcards
Source URL: https://quizplus.com/quiz/17663

Sample Questions
Q1) The remove method removes all occurrences of the item from a list.
A)True
B)False

Q2) The _______________ exception is raised when a search item is not in the list
being searched.

Q3) What method or operator can be used to concatenate lists?


A) *
B) +
C) %
D) concat

Q4) The _______________ method is commonly used to add items to a list.

Q5) Lists are _______________, which means their elements can be changed.

Q6) The first step in calculating the average of the values in a list is to get the total of the
values.
A)True
B)False

Q7) The built-in function _______________ returns the length of a sequence.

Q8) A(n) _______________ is an object that holds multiple items of data.


Page 10
Q9) The _______________ method reverses the order of the items in the list.

Q10) A(n) _______________ is a span of items that are taken from a sequence.
To view all questions and flashcards with answers, click on the resource link above.

Page 11
Chapter 9: More About Strings
Available Study Resources on Quizplus for this Chatper
35 Verified Questions
35 Flashcards
Source URL: https://quizplus.com/quiz/17664

Sample Questions
Q1) Which method would you use to determine whether a substring is present in a string?
A) endswith(substring)
B) find(substring)
C) replace(string, substring)
D) startswith(substring)

Q2) Invalid indexes do not cause slicing expressions to raise an exception.


A)True
B)False

Q3) When accessing each character in a string, such as for copying purposes, you would
typically use a while loop.
A)True
B)False

Q4) Which list will be referenced by the variable list_strip after the execution of the
following code? list_string = '03/07/2008'
List_strip = list_string.split('/')
A) ['3', '7', '2008']
B) ['03', '07', '2008']
C) ['3', '/', '7', '/', '2008']
D) ['03', '/', '07', '/', '2008']

To view all questions and flashcards with answers, click on the resource link above.
Page 12
Chapter 10: Dictionaries and Sets
Available Study Resources on Quizplus for this Chatper
35 Verified Questions
35 Flashcards
Source URL: https://quizplus.com/quiz/17665

Sample Questions
Q1) Sets are immutable.
A)True
B)False

Q2) The index of the first key-value pair in a dictionary is 0.


A)True
B)False

Q3) What is the correct structure for creating a dictionary of month names to be
accessed by month numbers?
A) { 1 ; 'January', 2 ; 'february', 3 ; 'March' }
B) { 1 : 'January', 2 : 'february', 3 : 'March' }
C) [ 1 : 'January', 2 : 'february', 3 : 'March' ]
D) { 1, 2, 3 : 'January', 'february', 'March' }

Q4) The _______________ method clears the contents of a dictionary.

Q5) The issubset method can be used to determine whether set1 is a subset of set2.
A)True
B)False

Q6) You would typically use a for loop to iterate over the elements in a set.
A)True
B)False

Page 13
Q7) To add a single item to a set, you can use the set method _______________.

To view all questions and flashcards with answers, click on the resource link above.
Chapter 11: Classes and Object-Oriented Programming
Available Study Resources on Quizplus for this Chatper
35 Verified Questions
35 Flashcards
Source URL: https://quizplus.com/quiz/17666

Sample Questions
Q1) What is another name for the accessor methods?
A) Setters
B) Getters
C) Instances
D) Attributes

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

Q3) A class _______________ is a set of statements that define a class's methods


and data attributes.

Q4) What are the procedures that an object performs called?


A) Methods
B) Actions
C) Modules
D) Instances

Q5) What type of programming contains class definitions?


A) Procedural
B) Object
C) Object-oriented
D) Modular

Q6) _______________ provides a set of standard diagrams for graphically depicting


object-oriented systems. Page 14

To view all questions and flashcards with answers, click on the resource link above.
Chapter 12: Inheritance
Available Study Resources on Quizplus for this Chatper
35 Verified Questions
35 Flashcards
Source URL: https://quizplus.com/quiz/17667

Sample Questions
Q1) When there are several classes that have many common data attributes, it is better
to write a(n) _____ to hold all the general data.
A) superclass
B) subclass
C) object
D) method

Q2) Which method can you use to determine whether an object is an instance of a
class?
A) isinstance
B) isclass
C) isobject
D) isinheritance

Q3) In a UML diagram, what does the open arrowhead point to?
A) Superclass
B) Subclass
C) Object
D) Method

Q4) In a UML diagram depicting inheritance, you only write the name of the subclass.
A)True
B)False

To view all questions and flashcards withPage 15 click on the resource link above.
answers,
Chapter 13: Recursion
Available Study Resources on Quizplus for this Chatper
35 Verified Questions
35 Flashcards
Source URL: https://quizplus.com/quiz/17668

Sample Questions
Q1) A problem can be solved with recursion if it can be broken down into _____
problems.
A) smaller
B) one-line
C) manageable
D) modular

Q2) Recursive function calls are _______________ efficient than loops.

Q3) What is the first step that needs to be taken in order to apply a recursive approach?
A) Identify at least one case in which the problem can be solved without recursion.
B) Determine a way to solve the problem in all other circumstances using recursion.
C) Identify a way to stop the recursion.
D) Determine a way to return to the main function.

Q4) A recursive function includes _____ which are not necessary in a loop structure.
A) function calls
B) conditional clauses
C) overhead actions
D) object instances

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

Page 16
Chapter 14: GUI Programming
Available Study Resources on Quizplus for this Chatper
35 Verified Questions
35 Flashcards
Source URL: https://quizplus.com/quiz/17669

Sample Questions
Q1) The _____ accepts the user's commands.
A) register
B) CPU
C) operating system
D) ALU

Q2) Check buttons are displayed in groups and used to make mutually exclusive
selections.
A)True
B)False

Q3) Which widget will display multiple lines of text?


A) Label
B) Canvas
C) Message
D) Text

Q4) To use the showinfo function, the tkinter.messagebox module needs to be imported.
A)True
B)False

Q5) A(n) _______________ is a container that can hold other widgets and organize
the widgets in a window.

To view all questions and flashcards withPage


answers,
17 click on the resource link above.

You might also like