100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached
logo-home
CISC 121 EXAM QUESTIONS & ANSWERS 2024/2025 $10.49   Add to cart

Exam (elaborations)

CISC 121 EXAM QUESTIONS & ANSWERS 2024/2025

 6 views  0 purchase
  • Course
  • CISC 121
  • Institution
  • CISC 121

CISC 121 EXAM QUESTIONS & ANSWERS 2024/2025 What is a Python 3 program? - ANSWERSA Python 3 program is a file that only contains text that conforms to the syntax of the Python 3 programming language How is a Python 3 file created and edited? - ANSWERSUsing a text editor, which is distinct f...

[Show more]

Preview 3 out of 21  pages

  • August 7, 2024
  • 21
  • 2024/2025
  • Exam (elaborations)
  • Questions & answers
  • CISC 121
  • CISC 121
avatar-seller
Bensuda
CISC 121 EXAM QUESTIONS &
ANSWERS 2024/2025

What is a Python 3 program? - ANSWERSA Python 3 program is a file that only contains text that
conforms to the syntax of the Python 3 programming language



How is a Python 3 file created and edited? - ANSWERSUsing a text editor, which is distinct from - and
usually far less complex than - a word processing program like word.

It is most common to use a text editor that includes features friendly to Python programming. These
features might include:

-> Colourizing code to highlight certain common features of it;

-> Allowing for quick execution of a program using a "run" button;

-> Allowing the capture for analysis of any output from the program;

-> Debugging tools helpful for locating and fixing errors in programs;



Integrated development environments (IDEs) - ANSWERSAn IDE is a program that embodies some or all
the features described on the previous slide and perhaps many more.

An IDE called IDLE comes with downloads of Python 3. It's meant for beginners, and is usually not used
by experience Python programmers, but it's free and readily available.



Data vs code - ANSWERSWe tend to think of code as being the unchanging part of a program that
consists mostly of instructions that implement some algorithm, and data as the information those
instructions act on.



Data types - ANSWERSnumbers, strings and booleans



Numbers - ANSWERSPython's interpreter categorizes a number as either an int (integers, that is positive
or negative whole numbers) or a float (positive or negative numbers that may contain a fractional
portion)

,The way Python stores its floats means that they are usually just approximations of actual values. This is
because the number of bits used for storing a number is fixed, so the number of available float values is
finite, and values are stored internally in binary.

Python places no arbitrary length on the number if digits used in its integers.



Strings - ANSWERSStrings appear in Python programs as collections of zero or more characters
surrounded by either single quotes or double quotes.

A surprisingly useful entity in programming is the empty string, " ", that is, the string containing no
characters, said to have a length of 0.

Triple-quoted docstrings can be used for multi-line text, through using another escape code, \n, can also
let you build a regular string that, when displayed, shows up on more than one line in the screen.

There's a variety of text in Python 3 called an f-string that comes in handy when displaying various types
of data. You can recognize them in code by a lower or uppercase letter "f" that precedes their opening
quotation mark. f"Today is {day_name}."



Booleans - ANSWERSAn expression that evaluates to True or False



Variables - ANSWERSVariables in Python must be named as follows:

-> The name must start with a letter or an underscore

-> The rest of the name may contain letters, the numerals o through 9, or underscores, but no spaces.

-> Camel case

-> Snake case



Assignment - ANSWERSWhen we give a value to a variable in the way, we are performing what's called
an assignment. In Python, the equals sign, =, is used as the assignment operator. (count = 0)

The value of one variable can be copied to another in an assignment.

The creation of a new variable is called a declaration, and giving a variable its first value is often called
initialization. Declaration and initialization always occurs in the same step in Python 3.



Expressions - ANSWERSAn expression is anything that is a literal, or a variable or has some computable
value.

In an assignment statement, the part on the right of the assignment operator is an expression.

, Expressions are frequently formed using data operands joined by operators.



Arithmetic operators - ANSWERS+ addition

- subtraction

* multiplication

/ divison

// integer divison

% modulus

** power



String concatenation - ANSWERSThe joining of two strings using +.



The string "in" operator - ANSWERSComputes to true because the string on the left of the in operator
form all or part of the strings on the right of the in operator.

"moth" in "grandmother"



Using "not in" with strings - ANSWERSPutting the operator not in front of the in operator reverses the
meaning of in



Mixing numbers and strings in expressions - ANSWERSA common way to concatenate numbers with
strings is to convert the numeric parts of a mixed-types expression to strings. Converting between data
types is called casting, and a typical way of casting a number to a string, so that it may be concatenated
to other string, is str(age).

f-strings give us a way to more easily blend variables and other expression into single strings message =
f"{name} is {age} years old."



Comparison operators - ANSWERSComparison operators are typically used in comparisons of numbers
with numbers and strings with strings in so-called Boolean expressions. The result of such comparisons is
always either True or False.

Comparison operators play an important role in searching and sorting collection of data.

The benefits of buying summaries with Stuvia:

Guaranteed quality through customer reviews

Guaranteed quality through customer reviews

Stuvia customers have reviewed more than 700,000 summaries. This how you know that you are buying the best documents.

Quick and easy check-out

Quick and easy check-out

You can quickly pay through credit card or Stuvia-credit for the summaries. There is no membership needed.

Focus on what matters

Focus on what matters

Your fellow students write the study notes themselves, which is why the documents are always reliable and up-to-date. This ensures you quickly get to the core!

Frequently asked questions

What do I get when I buy this document?

You get a PDF, available immediately after your purchase. The purchased document is accessible anytime, anywhere and indefinitely through your profile.

Satisfaction guarantee: how does it work?

Our satisfaction guarantee ensures that you always find a study document that suits you well. You fill out a form, and our customer service team takes care of the rest.

Who am I buying these notes from?

Stuvia is a marketplace, so you are not buying this document from us, but from seller Bensuda. Stuvia facilitates payment to the seller.

Will I be stuck with a subscription?

No, you only buy these notes for $10.49. You're not tied to anything after your purchase.

Can Stuvia be trusted?

4.6 stars on Google & Trustpilot (+1000 reviews)

73243 documents were sold in the last 30 days

Founded in 2010, the go-to place to buy study notes for 14 years now

Start selling
$10.49
  • (0)
  Add to cart