Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

1) == means a. Set value to b. A test for equality c. Is not equal to d. An erro

ID: 3546056 • Letter: 1

Question

1)   == means

a.    Set value to

b.    A test for equality

c.    Is not equal to

d.   An error in entering code

2)   What does int() do?

a.    Displays a message on screen

b.    Displays a random number

c.    Convert characters to numbers

d.   None of the above

3)   In a code statement, a named value is

a.    A variable

b.    A branch

c.    A named value

d.   A loop

4)   Using conditional statements if/else, it is not necessary to indent code ____True ____False

5)   Functions

a.    Create a stack frame

b.    Can return a value(s)

c.    Avoid duplicating code

d.   A, B and C

6)   Arrays

a.    Store data items

b.    Are a type of variable

c.    Eliminate code duplication

d.   A and C

e.    B and C

f.     A, B and C

7)   A hash is

a.    Declared using {} symbol

b.    A dictionary in Python

c.    A data structure that associates a name with a value

d.   B and C

e.    A and B

f.     A, B and C

8)   Hashes have their own set of methods including append () ____True _____False

9)   To run a program from IDLE, press

a.    F2

b.    F12

c.    F5

d.   F7

10. Which of the following are examples of algorithms? (choose all correct options)  

a. Age of person

b. A recipe

c. A set of instructions for putting together a utility shed

d. The spelling checker of a word processor

11. Which of the following translates and executes instructions in Python programming language?

a. A compiler

b. A text editor

c. A loader

d. An interpreter

12. Which of the following outputs data in a Python program?

a. The input statement

b. The assignment statement

c. The print statement

d. The main function

13. What is IDLE used to do?

a. Edit Python programs

b. Save Python programs to files

c. Run Python programs

d. All of the above

14. What is the set of rules for forming sentences in a language called?

a. Semantics

b. Pragmatics

c. Syntax

d. Logic

15. The expression round( 23. 67) evaluates to which of the following values?

a. 23

b. 23.7

c. 24.0

16. Assume that the variable name has the value 33. What is the value of name after the assignment statement name = name * 2 executes?

a. 35

b. 33

c. 66

17. What is the output of the loop for count in range(5):
            print(count)?

a. 1 2 3 4 5

b. 1 2 3 4

c. 0 1 2 3 4

For questions 18

Explanation / Answer

1) b

2)d

3)a

4) false

5)d

6)f

7)f

8)true

9)c

10)c

11)a)

12)c

13)d

14)c

15)c

16)c)

17)a

18)value present at second row