Python Exam 1 - Tsvetkova

Ace your homework & exams now with Quizwiz!

Is Python case sensitive when dealing with identifiers?

Yes

Which of the following is an invalid statement? Correct! A). a b c = 1000 2000 3000 B). abc = 1,000,000 C). a_b_c = 1,000,000 D). a,b,c = 1000, 2000, 3000

A) a b c = 1000 2000 3000

Which of the following cannot be a variable? A) in B) on C) it D) __init__

A) in

Why are local variable names beginning with an underscore discouraged? A) they are used to indicate a private variables of a class B) they are used to indicate global variables C) they confuse the interpreter D) they slow down execution

A) they are used to indicate a private variables of a class

Which of the following is true for variable names in Python? A) unlimited length B) all private members must have leading and trailing underscores C) none of the mentioned D) underscore and ampersand are the only two special characters allowed

A) unlimited length

What is the maximum possible length of an identifier? 1) None 2) 79 3) 31 4) 63

1) none

Which of the following is an invalid variable? A) my_string_1 B) 1st_string C) foo D) _

B) 1st_string

Which of the following is invalid? A) __str__ = 1 B) None of the mentioned C) _a = 1 D) __a = 1

B) none of the mentioned

Which of the following is not a keyword? A) pass B) assert C) eval D) nonlocal

C) eval

All keywords in Python are in A. UPPER CASE B. lower case C. Capitalized D. None of the mentioned

D. None of the mentioned


Related study sets

Introduction to Sociology Ch. 10

View Set

日本語総まとめN2第4週の語彙

View Set

Biology Photosynthesis definitions

View Set

MRU4.4: Supply and Demand Terminology

View Set

ECON 201 CH.4-7 review Multiple choice

View Set

chapter five: integumentary system check your understanding

View Set

Estructura 1.1 - 1 - ¿Masculino o femenino?

View Set