Intro to Coding - Variables and Data Types

Ace your homework & exams now with Quizwiz!

Which of the following statements about variables or values are true? Check all that apply. A. Variables store values. B. Variables store permanent data. C. Values are the result of functions. D. Variables in code are useful only on a single occasion.

A. Variables store values. C. Values are the result of functions.

Complete each statement by choosing the correct answer from the drop-down menu. A. The ________ data type can hold whole positive and negative numbers. B. The terms TRUE and FALSE are usually associated with ________ data types. C. Values such as 9.0, -1245.1, and 0.777 are examples of ________ data types.

A. integer B. Boolean C. floating-point

Which of the following are characteristics of the Boolean data type? Check all that apply. A. It holds infinite values. B. It uses operators such as AND, OR, and NOT. C. It holds a TRUE or FALSE value. D. It is named after a nineteenth-century mathematician and logician

B. It uses operators such as AND, OR, and NOT. C. It holds a TRUE or FALSE value. D. It is named after a nineteenth-century mathematician and logician

Which of these are characteristics of a Python data type? Check all that apply. A. A Python data type is weakly typed. B. A Python data type can have numeric values. C. A Python data type can be shown by keys and values within brackets [ ]. D. A Python data type must be stated before it can be used in a program. E. A Python data type can be a string, a list, or a tuple with items that can be repeated using the asterisk ( * ). F. A Python data type can be a dictionary that can be updated, changed, or removed. G. A Python data type cannot have connecting sets of characters separated by commas.

A. A Python data type is weakly typed. B. A Python data type can have numeric values. C. A Python data type can be shown by keys and values within brackets [ ]. E. A Python data type can be a string, a list, or a tuple with items that can be repeated using the asterisk ( * ). F. A Python data type can be a dictionary that can be updated, changed, or removed.

Use the drop-down menus to correctly complete these sentences about common data types. A. A variable that is used in programming and can hold a true or false value is a(n) ________ data type. B. A variable that can hold a mixed sequence of letters and numbers is a(n) ________ data type. C. A variable that can hold positive or negative whole-number values is a(n) ________ data type. D. A variable that can be used with moveable decimal points is a(n) ________ data type.

A. Boolean B. alphanumeric string C. integer D. floating-point number

Which of the following statements are true of an integer data type? Check all that apply. A. It can be a whole number. B. It can be a negative number. C. It uses TRUE/FALSE statements. D. It represents temporary locations. E. It cannot hold a fraction or a decimal number.

A. It can be a whole number. B. It can be a negative number. E. It cannot hold a fraction or a decimal number.

Use the drop-down menu to correctly complete these sentences about the five standard Python data types. A. ________ are numeric values in Python data types. B. A ________ is a large and changeable list that can contain any number of Python objects. C. ________ are connected sets of characters separated by quotation marks " ". D. ________ are sets of data separated by a comma between two parenthesis ( ). E. ________ are sets of data separated by a comma between two brackets [ ].

A. Numbers B. dictionary C. Strings D. Tuples E. Lists

Identify the correct characteristics of Python numbers. Check all that apply. A. Python numbers can be large integers. B. Python numbers can be complex values such as 12B16cd. C. Python numbers can be floating-point numbers. D. Python numbers have numeric values. E. Python numbers are created automatically.

A. Python numbers can be large integers. B. Python numbers can be complex values such as 12B16cd. C. Python numbers can be floating-point numbers. D. Python numbers have numeric values.

Identify the correct characteristics of Python strings. Check all that apply. A. Python strings connect sets of characters inside quotation marks. B. Python strings change numbers into integers. C. Python strings can be used to store text. D. Python strings use either single quotes or double quotes.

A. Python strings connect sets of characters inside quotation marks. C. Python strings can be used to store text. D. Python strings use either single quotes or double quotes.

Use the drop-down menus to correctly complete these sentences about how variables can be defined. A. ________ are single numbers or values, which may include integers, floating-point decimals, or strings of characters. B. A(n) ________ is a group of scalar or individual values that are stored in one entity. C. A(n) ________ is a data type that is assigned a true or false value by a programmer. D. A(n) ________ is a data type that can be assigned multiple values.

A. Scalar values B. array C. user-defined type D. abstract data type

Which of the following are characteristics of global variables? Check all that apply. A. They are accessible from anywhere in the program. B. They are accessible only in specific regions of a program. C. They are accessible only within a declared function. D. They are accessible during the entire time the program is running.

A. They are accessible from anywhere in the program. D. They are accessible during the entire time the program is running.

Which of these are characteristics of variables? Check all that apply. A. Variables can be local or global. B. Variables cannot be changed. C. Variables have keys and values within brackets [ ]. D. Variables have connected sets of characters. E. Variables have names, extents, and scopes.

A. Variables can be local or global. E. Variables have names, extents, and scopes.

Which of these are correctly formatted Python dictionaries? Check all that apply. A. dict = {'Name': 'Matthew', 'Age': 14, 'School': 'ABC School'}; B. dict = ('Name': 'Mary', 'Age': 13, 'School': 'XYZ School') C. dict = ["Programming Basics", "Introduction to Python"] D. dict = {'season': 'fall', 'weather': 'cool'}; E. dict = '['laptop', 'computer', 'hard drive']

A. dict = {'Name': 'Matthew', 'Age': 14, 'School': 'ABC School'}; D. dict = {'season': 'fall', 'weather': 'cool'};

Complete each sentence by choosing the correct answer from the drop-down menu. A. The data type in a strongly typed language ________ before the variable can be used. B. An example of a strongly typed language is ________. C. The data type in a weakly typed language ________ before the variable can be used. D. An example of a weakly typed language is ________.

A. has to be stated B. JavaScript C. does not have to be stated D. Python

Which of the following are common data types? Check all that apply. A. integers B. characters C. extents D. floating point numbers E. Boolean F. alphanumeric strings

A. integers B. characters D. floating point numbers E. Boolean F. alphanumeric strings

Complete each statement by choosing the correct answer from the drop-down menu. A. An array can have more than one ________. B. User-defined types allow programmers to ________. C. The ________ of a variable means that the variable has a beginning and an ending in time. D. A(n) ________ is accessible only in a specific region of a program or within a declared function.

A. scalar value B. define their own data types C. extent D. local variable

Which of these are correctly formatted Python tuples? Check all that apply. A. tup1=('computer science', 'math', 'psychology') B. list1=["final", "complete", "finish"] C. tup2="Programming 101", "Intro to Python" D. tup3=["MacBook", "Dell", "IBM"] E. tup4=('laptop', 'computer', 'hard drive')

A. tup1=('computer science', 'math', 'psychology') C. tup2="Programming 101", "Intro to Python" E. tup4=('laptop', 'computer', 'hard drive')

Identify the correct characteristics of a Python dictionary. Check all that apply. A. A Python dictionary is a container. B. A Python dictionary has keys and corresponding values. C. A Python dictionary is enclosed in curly braces { }. D. A Python dictionary can store any combination of Python objects.

All of them are correct.

Identify the correct characteristics of Python lists. Check all that apply. A. Python lists are enclosed in curly braces { }. B. Python lists contain items separated by commas. C. Python lists are versatile Python data types. D. Python lists may use single quotes, double quotes, or no quotes.

B. Python lists contain items separated by commas. C. Python lists are versatile Python data types. D. Python lists may use single quotes, double quotes, or no quotes.

Identify the correct characteristics of Python tuples. Check all that apply. A. Python tuples can be updated. B. Python tuples are similar to Python lists. C. Python tuples are enclosed in brackets [ ]. D. Python tuples are versatile. E. Python tuples are read-only lists.

B. Python tuples are similar to Python lists. D. Python tuples are versatile. E. Python tuples are read-only lists.

Which of these are correctly formatted Python lists? Check all that apply. A. list1=(race, cars, trucks, bikes) B. list2=['computer science', 'math', 'psychology'] C. list3=["Programming 101", "Intro to Python"] D. list4=('summer', 'fall', 'winter', 'spring') E. list5=[52, 24, 71, 72, 56]

B. list2=['computer science', 'math', 'psychology'] C. list3=["Programming 101", "Intro to Python"] E. list5=[52, 24, 71, 72, 56]


Related study sets

Chapter 13 Infectious Disease Prevention and Control

View Set

Income Tax - Chapter 2 Key Points

View Set

Access Chapter 1: End of Chapter Quiz

View Set

Chapter 13 - Labor and Birth Process Comb

View Set