• Wrong document? Swap it for free
  • Written by students who passed
  • Immediately available after payment
  • Read online or as PDF
Sell
Where do you study
Your language
Document preview thumbnail
Preview 3 out of 17 pages
Exam (elaborations)

D522 Python for IT Automation Exam Question with Verified Correct Answers

Document preview thumbnail
Preview 3 out of 17 pages

D522 Python for IT Automation Exam Question with Verified Correct Answers

Content preview

D522 Python for IT Automation Exam
Question with Verified Correct Answers
Naming Conflict

Occurs when global and local variables share the same name, potentially causing confusion.

Separation of Concerns

Using proper scope to keep program logic organized and maintainable.

Data Type

A classification that specifies the kind of value a variable can store.

Dynamic Typing (Python)

Python determines a variable's type at runtime without explicit declaration.

Integer (`x = 5`)

A numeric data type representing whole numbers.

Float (`y = 3.14`)

A numeric data type representing decimal numbers.

String (`message = "Hello"`)

A sequence of characters enclosed in single or double quotes.

Boolean (`is_true = True`)

A data type that represents either True or False.

List (`my_list = [1, 2, 3]`)

An ordered, mutable sequence of values.

,Tuple (`my_tuple = (1, 2, 3)`)

An ordered, immutable sequence of values.

Range (`my_range = range(5)`)

A sequence type representing a range of numbers.

Dictionary (`my_dict = {'key': 'value'}`)

A mapping type that stores key-value pairs.

Set (`my_set = {1, 2, 3}`)

An unordered collection of unique elements.

NoneType (`my_variable = None`)

Represents the absence of a value.

Type Casting (`int(42)` or `str(42)`)

Explicitly converting a value from one data type to another.

Integer (int) (`x = 5`)

A whole number without a decimal point that can be positive or negative.

Floating-Point (float) (`pi = 3.14`)

A number with a decimal point or scientific notation.

Scientific Notation (`2.0e3`)

A float representation using exponential notation equal to 2000.0.

Mixed-Type Promotion (`5 + 3.14`)

When an int and float are used together, Python automatically converts the result to float.

, Arithmetic with Integers (`x + y`)

Standard math operations applied to whole numbers.

int() Conversion (`int(3.14)`)

Converts a float to an integer by truncating the decimal portion.

float() Conversion (`float(5)`)

Converts an integer into a floating-point number.

round() Function (`round(3.14159, 2)`)

Rounds a number to a specified number of decimal places.

abs() Function (`abs(-5)`)

Returns the absolute (non-negative) value of a number.

Truncation (`int(3.99)`)

Drops the decimal portion instead of rounding when converting to int.

Random Module (`import random`)

Built-in module used to generate random numbers.

Random Range (`random.randrange(1, 101)`)

Generates a random integer within a specified range.

String (`greeting = "hello"`)

A sequence of characters enclosed in single or double quotes.

Multiline String (`"""line1\nline2"""`)

A string that spans multiple lines using triple quotes.

Document information

Uploaded on
September 15, 2026
Number of pages
17
Written in
2026/2027
Type
Exam (elaborations)
Contains
Questions & answers
$13.99

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

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
KenAli
2.6
(18)
Sold
126
Followers
5
Items
27312
Last sold
1 week ago



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