Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Python Programming: Anonymous Functions, Global Variables, Immutable Data Types, and More, Quizzes of Computer Science

Definitions for various terms related to python programming, including lambda functions, global variables, immutable data types, runtime errors, semantic errors, cloning, and more. Understanding these concepts is essential for writing effective and efficient python code.

Typology: Quizzes

2013/2014

Uploaded on 04/05/2014

heaianna17
heaianna17 🇺🇸

1 document

1 / 10

Toggle sidebar

Related documents


Partial preview of the text

Download Python Programming: Anonymous Functions, Global Variables, Immutable Data Types, and More and more Quizzes Computer Science in PDF only on Docsity! TERM 1 lambda DEFINITION 1 A piece of code which can be executed as if it were a function but without a name.(Lambda is also a keyword used to create such an anonymous function.) TERM 2 global variable DEFINITION 2 A global variable is a variable that can be seen (is visible) throught a program module. Dened outside of all functions. TERM 3 immutable data type DEFINITION 3 A (compound) data type in which the elements can not be modied. TERM 4 runtime error DEFINITION 4 An error raised by the python runtime while the program is executing if something goes wrong. For example, a divide by zero error. TERM 5 semantic error DEFINITION 5 An error (in code) that leads to unexpected behavior. The program functions correctly (does what the code says) but the code does not actually perform the action thatthe programmer intended. TERM 6 clone DEFINITION 6 In python, the operation of making a complete copy of some dataitem, such as a picture or a list. This allows you to modify the clone without aecting the original. TERM 7 le DEFINITION 7 A named entity, usually stored on a hard drive, USB drive, or CDROM, that contains a stream of characters or bytes. TERM 8 proprioception DEFINITION 8 Sensors that detect internal state. On your scribbler, stall, time andbattery voltage are examples of internal sensors. For you, proprioception allows you to know the relative position of parts of your body, which allows you to do things like touch your nose with your eyes closed. TERM 9 slice DEFINITION 9 A subsequence copied from a sequence specied by a range of indices. The slice operator is: sequence[start:stop]. TERM 10 int DEFINITION 10 int - A numerical data type that stores numbers without a fractionalcomponent (such as -3, 5, 0, etc...) TERM 21 keyword DEFINITION 21 A reserved word that is used by the compiler to parse program; you cannot use keywords likeif,def, andwhileas variable names. TERM 22 variable DEFINITION 22 A name that refers to a value. TERM 23 function DEFINITION 23 A named sequence of statements that performs some useful operation. Functions may or may not take parameters and may or may not produce a result. TERM 24 block DEFINITION 24 A group of consecutive statements with the same indentation. TERM 25 Boolean expression DEFINITION 25 An expression that is either true or false.Typicallycontains a comparison operator ( <, >, <=, >=, ==, !=) and may containboolean operators such as AND, OR, or NOT. TERM 26 None DEFINITION 26 A special Python value. One use in Python is that it is returned by functions that do not execute a return statement with a return argument. TERM 27 iteration DEFINITION 27 Repeated execution of a set of programming statements. TERM 28 loop DEFINITION 28 The construct that allows allows us to repeatedly execute a statement or a group of statements until a terminating condition is satisfied. TERM 29 tuple DEFINITION 29 An immutable data value that contains related elements. Tuples are used to group together related data, such as a persons name, their age, and their gender. TERM 30 file DEFINITION 30 A named entity, usually stored on a hard drive, floppy disk, or CD-ROM, that contains a stream of characters. TERM 31 dictionary DEFINITION 31 A collection of key:value pairs that maps from keys to values. The keys can be any immutable value, and the associated value can be of any type. TERM 32 key DEFINITION 32 A data item that ismapped toa value in a dictionary. Keys are used to look up values in a dictionary. Each key must be unique across the dictionary. TERM 33 conditional statement DEFINITION 33 A statement that controls the flow of execution depending on some condition. In Python the keywordsif,elif, andelseare used for conditional statements. TERM 34 type conversion DEFINITION 34 An explicit function call that takes a value of one type and computes a corresponding value of another type. TERM 35 evaluate DEFINITION 35 To simplify an expression by performing the operations in order to yield a single value.
Docsity logo



Copyright © 2024 Ladybird Srl - Via Leonardo da Vinci 16, 10126, Torino, Italy - VAT 10816460017 - All rights reserved