Python Input, Processing, Output, and Turtle Graphics

0.0(0)
studied byStudied by 2 people
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/46

flashcard set

Earn XP

Description and Tags

Flashcards covering the basics of input, processing, output, and turtle graphics in Python.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

47 Terms

1
New cards

Algorithm

A set of well-defined logical steps that must be taken to perform a task.

2
New cards

Pseudocode

Informal language that has no syntax rule used to create model program, which can be translated directly into actual code in any programming language

3
New cards

Flowchart

Diagram that graphically depicts the steps in a program.

4
New cards

print function

Displays output on the screen.

5
New cards

String Literal

A string that appears in the actual code of a program and must be enclosed in single (') or double (") quote marks.

6
New cards

Comments

Notes of explanation within a program ignored by Python interpreter.

7
New cards

Variable

Name that represents a value stored in the computer memory.

8
New cards

Assignment statement

Used to create a variable and make it reference data.

9
New cards

Garbage collection

Removal of values that are no longer referenced by variables.

10
New cards

Data types

Categorize value in memory (e.g., int, float, str).

11
New cards

Numeric literal

Number written in a program. No decimal point considered int, otherwise, considered float.

12
New cards

input function

Built-in function that reads input from keyboard and returns the data as a string.

13
New cards

Nested function call

function1(function2(argument)), value returned by function2 is passed to function1

14
New cards

Math expression

Performs calculation and gives a value.

15
New cards

Math operator

Tool for performing calculation.

16
New cards

Operands

Values surrounding operator and can be a variable.

17
New cards

Exponent operator

Raises a number to a power (x ** y = xy).

18
New cards

Remainder operator

Performs division and returns the remainder (a.k.a. modulus operator).

19
New cards

Multiline continuation character

Allows to break a statement into multiple lines

20
New cards

String Concatenation

To append one string to the end of another string; use the + operator.

21
New cards

Named constant

Name that represents a value that does not change during the program's execution

22
New cards

Magic Number

An unexplained numeric value that appears in a program’s code.

23
New cards

Turtle

Python's turtle graphics system displays a small cursor known as a turtle. You can use Python statements to move the turtle around the screen, drawing lines and shapes.

24
New cards

turtle.forward(n)

Statement to move the turtle forward n pixels.

25
New cards

turtle.right(angle)

Statement to turn the turtle right by angle degrees.

26
New cards

turtle.left(angle)

Statement to turn the turtle left by angle degrees.

27
New cards

turtle.setheading(angle)

Statement to set the turtle's heading to a specific angle.

28
New cards

turtle.penup()

Statement to raise the pen so the turtle does not draw as it moves.

29
New cards

turtle.pendown()

Statement to lower the pen so the turtle draws as it moves.

30
New cards

turtle.circle(radius)

Statement to draw a circle with a specified radius.

31
New cards

turtle.dot()

Statement to draw a simple dot at the turtle's current location.

32
New cards

turtle.pensize(width)

Statement to change the width of the turtle's pen, in pixels.

33
New cards

turtle.pencolor(color)

Statement to change the turtle's drawing color.

34
New cards

turtle.bgcolor(color)

Statement to set the window's background color.

35
New cards

turtle.setup(width,height)

Statement to set the size of the turtle's window, in pixels.

36
New cards

turtle.reset()

Statement that erases all drawings, resets color to black, and resets turtle position.

37
New cards

turtle.clear()

Statement that erases all drawings but does not change turtle position or color.

38
New cards

turtle.clearscreen()

Statement that erases all drawings, resets color to black, resets turtle position, and resets background color to white.

39
New cards

turtle.goto(x, y)

Statement to move the turtle to a specific location.

40
New cards

turtle.speed(speed)

Command to change the speed at which the turtle moves. The speed argument is a number in the range of 0 through 10.

41
New cards

turtle.hideturtle()

Command to hide the turtle, does not change the way graphics are drawn, it simply hides the turtle icon.

42
New cards

turtle.showturtle()

Command to display the turtle.

43
New cards

turtle.write(text)

Statement to display text in the turtle's graphics window.

44
New cards

turtle.begin_fill()

Command used before drawing a shape to fill it with color.

45
New cards

turtle.end_fill()

Command used after drawing a shape to fill it with the current fill color.

46
New cards

turtle.numinput('Input', 'Enter your age')

Command used to get input with a dialog box.

47
New cards

turtle.done()

Command used at the end of a turtle graphics program to keep the graphics window open.