Exam 1: Introduction to Python: Introduction to Numeric Types, Turtle Graphics, Simple for Loops and Functions

arrow
  • Select Tags
search iconSearch Question
flashcardsStudy Flashcards
  • Select Tags

1. Match each definition with its term. -A method that creates a new object.

Free
(Multiple Choice)
4.9/5
(41)
Correct Answer:
Verified

D

Describe the rules that Python imposes on the possible values for name in the statement below. name = python expression

Free
(Essay)
4.8/5
(37)
Correct Answer:
Verified

There are several important rules to remember about naming things in Python. Names can include any letter, number, or an _ (underscore). Names must start with either a letter or an _. Python is case sensitive, which means that the names baseArea, basearea, and BaseArea are all different. Some names are reserved by Python for its own use. These are called keywords and correspond to important Python capabilities.

What is the result of the expression 15//2?

Free
(Multiple Choice)
4.8/5
(47)
Correct Answer:
Verified

B

Given the following function definition, which of the statements below produces a square? Def drawPolygon(myTurtle, sideLength, numSides): TurnAngle = 360 / numSides For i in range(numSides): MyTurtle.forward(sideLength) MyTurtle.right(turnAngle)

(Multiple Choice)
4.9/5
(36)

Case Study 2: The turtle module provides us with a simple graphics programming tool known as a "turtle." Very simply, a turtle is an object that we can control. A turtle can move forward or backward, and it can turn in any direction. When a turtle moves, it draws a line if its tail is down. A turtle object has both attributes and methods. -The turtle method ____ does not take any parameters.

(Multiple Choice)
4.8/5
(32)

1. Match each definition with its term. -The name found on the left side of the equals sign in an expression.

(Multiple Choice)
4.7/5
(39)

What is abstraction, and how does this concept relate to a "black box?"

(Essay)
4.9/5
(39)

How does your text differentiate the three levels of problem-solving?

(Multiple Choice)
4.9/5
(34)

Consider the following for loop template. How many times will statement1 be executed? For i in range(5): Statement1 Statement2 )..

(Multiple Choice)
4.9/5
(38)

Machine learning is providing key help on the forefront of diagnosing disease.

(True/False)
4.9/5
(34)

Describe the types of primitive objects that Python provides for working with numbers.

(Essay)
4.9/5
(40)

Explain how the Python interpreter evaluates the statement below. name = python expression

(Essay)
4.9/5
(34)

The expression turtle.Turtle() contains the dot(.) operator. What is the purpose of this operator?

(Essay)
4.9/5
(29)

You have been asked to answer the following question: "A class has 12 students. At the beginning of class, each student shakes hands with each of the other students. How many handshakes take place?" Explain how you would use a simplification strategy to answer this question.

(Essay)
4.8/5
(34)

Illustrate how computer science is used every day with an example.

(Essay)
4.9/5
(40)

You have entered a calculation in the Python interpreter. To see the result of this calculation, which key would you press?

(Multiple Choice)
4.8/5
(37)

The Python language contains many abstractions that are built by using Python elements. In other words, much of Python is written in Python.

(True/False)
4.7/5
(35)

What do you use to associate an object name with an expression in Python?

(Multiple Choice)
4.8/5
(46)

Case Study 2: The turtle module provides us with a simple graphics programming tool known as a "turtle." Very simply, a turtle is an object that we can control. A turtle can move forward or backward, and it can turn in any direction. When a turtle moves, it draws a line if its tail is down. A turtle object has both attributes and methods. -One of the attributes of a turtle is:

(Multiple Choice)
4.9/5
(30)

1. Match each definition with its term. -Step-by-step instructions that provide a solution to a problem.

(Multiple Choice)
4.8/5
(32)
Showing 1 - 20 of 34
close modal

Filters

  • Essay(0)
  • Multiple Choice(0)
  • Short Answer(0)
  • True False(0)
  • Matching(0)