




Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!





Syntax - Correct Answer-A set of rules used to determine if a certain string of words form a valid sentence. *Syntactically-each language has its rules and they must be obeyed. Semantics - Correct Answer-A set of rules determining if a certain phrase makes sense. *Semantically-the program has to make sense. Lexis - Correct Answer-(Aka Dictionary) as set of words the language offers its users. *Lexically-each programming language has its dictionary and you need to master it. Interpreting - Correct Answer-you can translate the source program each time it has to be run; the program performing this kind of transformation is called an interpreter. As it interprets the code every time it is intended to be executed; it also means that you cannot just distribute the source code as-is, because the end-user needs the interpreter to execute it. *Python is an interpreted Language
Interpreter - Correct Answer-An interpreter is a program that reads and executes code -An interpreter will:
Complex #'s are the #'s which we can't represent on a # line. Strings - Correct Answer-Are used when you need to process text. (Strings need "quotes"). It is not intended to be executed, and should be taken as is. Comments - Correct Answer-A comment is a piece of text that begins with [#] (hash) sign and extends to the end of the line. [print()] - Correct Answer-is a function that prints the specified message to the screen, or other standard output device. [input()] - Correct Answer-The [inpout()] function is able to read data entered by the user and to return the same data to the running program. The program can manipulate the data, making the code truly interactive. *The function will switch the console to input mode. *The result of the [input()] function is also a string. [0b] - Correct Answer-binary [0o] - Correct Answer-Octal: If an integer # is preceded by an [0o] prefix (zero - o) it will be treated as an octal value. This means that the # must contain digits taken from the {0.....7} range only. [0x] - Correct Answer-Hexadecimal
Numeric Operators - Correct Answer-Symbols in programming language, which are able to operate on the values. Example: + , - , * , / , // , % , ** [] - Correct Answer-A double asterisk sign is an exponentiation (power) operator. The left argument is the base, its right, the exponent. Example: [23] [*] - Correct Answer-An asterisk is multiplication [/] - Correct Answer-A slash is division Note: The result produced by the division operator is always a float [%] - Correct Answer-A [%] (percent sign) is a reminder (modulo), aka remainder left after the integer division. Example: [14%4] = 4+4+4=12 14/12= [//} - Correct Answer-A [//] (double slash) sign is an integer divisional operator. NOTE: NOT FLOAT!! The answer is rounded to the lesser integer. Example: 2.7=2 2.3=
[10,"hello",200.3] Dictionaries - Correct Answer-Unordered key:value pairs {"mykey":"value", "name":"Frank"} Tuples - Correct Answer-Ordered immutable sequences of objects. AKA you cannot edit them. (10,"hello",200.3) Sets - Correct Answer-Unordered collection of unique objects. {"a","b"} [type()] - Correct Answer-Is used to check the type of object a variable is a= type(a) int [len()] - Correct Answer-Checks the length of the input len("hello")
list1 = [1,2,3] - Correct Answer-Lists can be changed dict1 = {'key1': 'value1'} - Correct Answer-dictionary can be changed tuple1 = (1,2,3) - Correct Answer-Tuples cannot be changed list.index('b') - Correct Answer-identified the index position of an item in a list