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)

Introduction to Programming in Python - C859 (WGU C859 Actual Exam) (Comprehensive Document for Exam Preparation)

Rating
-
Sold
-
Pages
35
Grade
A+
Uploaded on
03-09-2024
Written in
2024/2025

Introduction to Programming in Python - C859 (WGU C859 Actual Exam) (Comprehensive Document for Exam Preparation)

Institution
ATI
Course
ATI

Content preview

Python WGU C859

Version 1



Programming Chapter One



1. Program: consists of instructions executing one at a time. Basic
instruction types are:



Input: A program receives data 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 a file, screen, or
network.



2. algorithm: A sequence of instructions that solves a problem



3. Python Interpreter: a computer program that executes code written in
the Python programming language



4. Interactive interpreter: a program that allows the user to execute one
line of code at a time.



5. Code: a common word for the textual representation of a program (and
hence programming is also called coding). A line is a row of text.

,6. Statement: is a program instruction. A program mostly consists of a
series of statements, and each statement usually appears on its own line.



7. Expressions: are code that return a value when evaluated; for example,
the code

wage * hours * weeks is an expression that computes a number. The symbol
* is

used for multiplication. The names wage, hours, weeks, and salary are
variables,

which are named references to values stored by the interpreter.



8. New Variable: is created by performing an assignment using the =
symbol, such

as salary = wage * hours * weeks, which creates a new variable called salary.



9. print() function: displays variables or expression values.



10. string literal: Text enclosed in quotes is known as



11. end=' ': inside of print() to keep the output of a subsequent print
statement on

the same line separated by a single space.



12. newline character: Output can be moved to the next line by printing "\
n". Ex:

print('1\n2\n3') prints "1" on the first line, "2" on the second line, and "3" on
the third

line of output. "\n" consists of two characters, \ and n, but together are
considered

by the Python interpreter as a single character.

,13. whitespace: Any space, tab, or newline



14. input(): Reading input is achieved using. The statement best friend =
input()

will read text entered by the user and the best friend variable is assigned
with the

entered text. The function input() causes the interpreter to wait until the user
has

entered text and pushed the return key.



15. string: The input obtained by input() is any text that a user typed,
including

numbers, letters, or special characters such as # or @. Such text in a
computer

program is called



16. type: The string '123' (with quotes) is fundamentally different from the
integer

123 (without quotes). The '123' string is a sequence of the characters '1', '2',
and '3'

arranged in a certain order, whereas 123 represents the integer value one-
hundred

twenty-three. Strings and integers are each an example of... a type
determines how

a value can behave



17. int(): Reading from input always results in a string type. However, often
a

, programmer wants to read in an integer, and then use that number in a
calculation. If

a string contains only numbers, like '123', then the... function can be used to
convert

that string to the integer 123.



18. Syntax error: violates a programming language's rules on how symbols
can be

combined to create a program. An example is putting multiple prints on the
same

line.



19. runtime error: in which a program's syntax is correct but the program
attempts

an impossible operation, such as dividing by zero or multiplying strings
together (like

'Hello' * 'ABC').



20. Common Errors: Indentation Error - The lines of the program are not
properly

indented.

Value Error - An invalid value is used, which can occur if giving letters to int().

Name Error - The program tries to use a variable that does not exist.

Type Error - An operation uses incorrect types, which can occur if adding an
integer

to a string.



21. logic error: Some errors may be subtle enough to silently misbehave,
instead

Written for

Institution
ATI
Course
ATI

Document information

Uploaded on
September 3, 2024
Number of pages
35
Written in
2024/2025
Type
Exam (elaborations)
Contains
Questions & answers
$10.49
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
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.
BESTNURSING Walden University
View profile
Follow You need to be logged in order to follow users or courses
Sold
20
Member since
5 year
Number of followers
19
Documents
718
Last sold
9 months ago

4.0

1 reviews

5
0
4
1
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