Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Exam (elaborations)

Programming Fundamentals Exam Practice Questions And Correct Answers (Verified Answers) Plus Rationale 2026 Q&A

Rating
-
Sold
-
Pages
37
Grade
A+
Uploaded on
24-06-2026
Written in
2025/2026

Programming Fundamentals Exam Practice Questions And Correct Answers (Verified Answers) Plus Rationale 2026 Q&A

Institution
Programming Fundamentals
Course
Programming Fundamentals

Content preview

Programming Fundamentals Exam Practice
Questions And Correct Answers (Verified
Answers) Plus Rationale 2026 Q&A

SECTION 1: VARIABLES, DATA TYPES, & OPERATORS
1. Which of the following is a valid variable name in most programming
languages?
A) 2ndPlace
B) my-variable
C) _privateValue
D) class
Correct Answer: C | Rationale: Variable names typically cannot start with a
number (A), cannot contain hyphens (B), and cannot be reserved keywords like
"class" (D). Underscores (_) are allowed as the first character.
2. In Python, what data type is the value 3.14?
A) Integer
B) String
C) Float
D) Boolean
Correct Answer: C | Rationale: A number with a decimal point is a floating-point
number (float). An integer (A) has no decimal. A string (B) is text enclosed in
quotes. A boolean (D) is True/False.
3. What is the result of 10 // 3 in Python?
A) 3.33
B) 3
C) 4
D) 3.0

,Correct Answer: B | Rationale: The // operator performs integer (floor) division,
discarding the remainder. 10 divided by 3 is 3 with a remainder of 1, so the result
is 3. / (single slash) would return 3.33 (float).
4. What is the output of the following code?
python
x=5
y=2
print(x ** y)
A) 7
B) 10
C) 25
D) 32
Correct Answer: C | Rationale: The ** operator is the exponentiation (power)
operator. 5 raised to the power of 2 is 5 × 5 = 25.
5. Which operator is used to compare two values for equality in most languages
(e.g., Java, C++, Python)?
A) =
B) ==
C) !=
D) ===
Correct Answer: B | Rationale: == is the equality comparison operator. = is the
assignment operator. != means "not equal." === is strict equality in some
languages (JavaScript) but == is the standard.
6. What is the value of total after this code executes?
python
total = 0
total += 5

,total *= 2
total -= 3
A) 7
B) 10
C) 4
D) 13
Correct Answer: A | *Rationale: total starts at 0. +=5 makes it 5. =2 makes it 10. -
=3 makes it 7.
7. Which data type can only hold two possible values (True/False)?
A) Integer
B) Character
C) Boolean
D) Array
Correct Answer: C | Rationale: A Boolean (bool) data type represents logical
values: True or False (or 1/0 in some languages).
8. What is the result of "Hello" + " " + "World" in most languages?
A) "Hello World"
B) "HelloWorld"
C) Error
D) "Hello + World"
Correct Answer: A | Rationale: The + operator concatenates (joins) strings. Adding
a space string " " between them produces "Hello World".
9. A variable declared inside a function is known as a:
A) Global variable
B) Local variable
C) Constant
D) Parameter

, Correct Answer: B | Rationale: A local variable is declared within a function and
can only be accessed inside that function. A global variable (A) is declared outside
all functions and can be accessed anywhere.
10. What is the value of remainder after this code?
python
remainder = 17 % 5
A) 3
B) 2
C) 5
D) 3.4
Correct Answer: B | Rationale: The % operator is the modulus (remainder)
operator. 17 divided by 5 is 3 with a remainder of 2.
11. Which of the following is NOT a primitive data type in most languages?
A) int
B) float
C) string
D) char
Correct Answer: C | Rationale: In many languages (Java, C), String is a reference
type/object, not a primitive. However, in Python, everything is an object. This
question reflects classical terminology where primitives are int, float, char,
boolean.
12. What is the output of this code?
python
a = 10
b=3
print(a / b)

Written for

Institution
Programming Fundamentals
Course
Programming Fundamentals

Document information

Uploaded on
June 24, 2026
Number of pages
37
Written in
2025/2026
Type
Exam (elaborations)
Contains
Questions & answers

Subjects

$23.79
Get access to the full document:

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Get to know the seller
Seller avatar
docwillowivy
5.0
(1)

Get to know the seller

Seller avatar
docwillowivy Walden University
View profile
Follow You need to be logged in order to follow users or courses
Sold
8
Member since
8 months
Number of followers
1
Documents
2160
Last sold
1 day ago
Elite Study Hub

Reach your academic goals with professionally crafted, high-quality educational materials designed to help you study efficiently and achieve success Thank you for purchasing my documents on stuvia ! I hope you found it helpful .If you:re satisfied with your purchase ,i would really appreciate it if you could leave a review .Your feedback helps other student and supports my work .Thank you for your support! In my Stuvia store, you’ll find a wide range of study guides, summaries, past exams, solved questions, and revision notes — all written to be clear, accurate, and easy to follow. Each resource is well-organized and based on trusted textbooks, lectures, and verified coursework, ensuring you always receive dependable and valuable content. These materials are perfect for exam preparation, coursework enhancement, and quick revision, helping you master complex topics, save study time, and improve your grades with confidence. Whether you’re a college student, lifelong learner, or preparing for certification exams, you’ll discover the right tools to make your studying more effective and enjoyable. I specialize in creating concise, time-saving notes that simplify challenging concepts without leaving out key information — empowering you to learn faster and perform better in exams. Trusted by students worldwide, all resources are available for instant download, giving you immediate access to premium study materials whenever you need them. Invest in your academic success today — study smarter, stay organized, and reach your goals with professional, accurate, and easy-to-understand learning resources designed to support your educational journey.

Read more Read less
5.0

1 reviews

5
1
4
0
3
0
2
0
1
0

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions