D335 - Intro to Programming in Python With Questions And 100% SURE ANSWERS
Terms in this set (76)
Input A program gets data, perhaps from a file, keyboard, touchscreen, network, etc.
Process A program performs computations on that data, such as adding two values like x + y.
Output A program puts that data somewhere, such as to a file, screen, or network.
Programs use _____ to refer to data, like x, y, and z below. The name is due to a variable's value
variables
"varying" as a program assigns a variable like x with new values.
interactive interpreter An ___________ is a program that allows the user to execute one line of code at a time.
Code is a common word for the textual representation of a program
line A_____ is a row of text.
The interactive interpreter displays a _______ that indicates the interpreter is ready to accept
prompt (">>>")
code.
A _________ is a program instruction. A program mostly consists of a series of _______ , and each
statement
_ _____ usually appears on its own line.
D335 - Intro to Programming in Python
1/5
, 10/16/24, 6:53 AM
are code that return a value when evaluated; for example, the code wage * hours * weeks is an
_ ____ that computes a number. The symbol * is used for multiplication. The names wage, hours,
Expressions
weeks, and salary are variables, which are named references to values stored by the
interpreter.
A new variable is created by performing an _______using the = symbol, such as salary = wage *
assignment
hours * weeks, which creates a new variable called salary.
print() The ____ function displays variables or expression values.
#' characters denote _______ , which are optional but can be used to explain portions of code
comments
to a human reader.
Purpose of variables store values for later use
How most Python Programs are developed writing code in files
The primary way to print output is to use the built-in function print(). Ex: print('hello world').
string literal
Text enclosed in quotes is known as a __________
Each use of print() ____________ starts on a new line
Each call to print() outputs on a new line. However, sometimes a programmer may want to
end=' ' keep output on the same line. A programmer can add __ inside of print() to keep the output
of a subsequent print statement on the same line separated by a single space.
(without quotes around variable_name) The value of a variable can be printed out via: print(variable_name) _______________
newline character Output can be moved to the next line by printing "\n", known as a _________
whitespace Any space, tab, or newline is called __________
Add X, #num, Y Adds data in memory location X to the number num, storing result in location Y
Sub X, #num, Y Subtracts num from data in location X, storing result in location Y
Mul X, #num, Y Multiplies data in location X by num, storing result in location Y
Div X, #num, Y D335 - Intro to Programming
Divides in
dataPython
in location X by num, storing result in location Y
2/5
The benefits of buying summaries with Stuvia:
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
You can quickly pay through credit card or Stuvia-credit for the summaries. There is no membership needed.
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 Queenstin. Stuvia facilitates payment to the seller.
Will I be stuck with a subscription?
No, you only buy these notes for $10.99. You're not tied to anything after your purchase.