click below
click below
Normal Size Small Size show me how
IPT MOD 1&2
| Question | Answer |
|---|---|
| It is the concepts of classes, objects, and encapsulation etc. | Object Oriented Language |
| Where did Python gets its name? | Monty Python’s Flying Circus |
| A sequence of instructions written so that a computer can perform certain task. | program |
| Python can run on a wide variety of hardware platforms and the same interface on all platform. | True |
| In what year, Python was conceived? | 1980s |
| Python is a compiled programming language. | False |
| Python is powerful language. | True |
| One of the key features of python. | Object Oriented *** |
| Implementation of Python was started in December 1989. | True |
| James Gosling created Python programming. | False James Gosling created Java, not Python. Python was created by Guido van Rossum. |
| Pybrain for scientific computation. | False machine learning and neural networks, not for general scientific computation (that’s more for NumPy, SciPy, etc.). |
| Python provides several libraries that can process and analyze data on the fly. | True |
| Java type commands into interpreter and see immediate results. | false Java code must be compiled into bytecode and then run on the Java Virtual Machine (JVM). This is different from interpreted languages like Python, where you can type commands and see results immediately. |
| In installing Python, run the installer by single-clicking on the downloaded file. | True |
| Analytics and Artificial Intelligence are becoming popular and in demand in today's technology. | True |
| The python shell is the interactive environment. | True |
| Spicy for scientific computation. | False |
| Readability of a Python program is generally enhanced by the fact that code is broken up into blocks by certain Python constructions. | True |
| What prebuilt library of Python for advanced computing? | Numpy |
| Readability of a Python program is generally enhanced by the fact that code is broken up into blocks by certain Python constructions. | Block Structure |
| A program is a sequence of instructions written so that a computer can perform a certain task. | True |
| Python was invented in United States. | False, Netherlands |
| Python provides rich set of module and functions. | Extensive Libraries |
| When is the implementation of Python started? | December 1989 |
| Python is ideal language for scripting and rapid application development in many areas on most platforms. | True |
| Pybrain for Machine Learning that is connected to AI. | True |
| In installing Python, run the installer by double-clicking on the downloaded file. | True |
| The python shell is the interactive environment. | True |
| The Python interpreter can be invoked by typing the command "python" without any parameter followed by the "__________” key at the shell prompt. | return |
| Combines a program editor and a language environment as a convenience to the programmer. | IDE |
| Spicy for advanced computing. | True daw pero dapat, SciPy un |
| Numpy for Machine Learning that is connected to AI. | False |
| Namespace are different modules can use the same names without causing name clashes. | True |
| Python can run on the same interface on all platform. | Portable |
| Python is not embeddable and don’t have extensive libraries. | False |
| A type of programming language in which we can write code to control another software application. | scripting |
| Python was conceived in the late 1970s. | False |
| Python Interpreter allows you to type commands one-at-a-time and see results. | True |
| Which year Python Programming was published? | 1991 |
| Interactive environment that allows you to type in some Python code. | Python shell |
| Numpy for advanced computing. | False |
| A great way to explore Python's syntax. | Interpreter |
| Type ________ into interpreter and see immediate results. | commands |
| The acronym IDLE stands for: | Integrated Development and Learning Environment |
| Python allows you to type commands one-at-a-time and see results. | True |
| What prebuilt library of Python for advanced computing? | Spicy |
| Python is hard to learn. | False |
| Freely distribute copies of the software. | Free and Open Source |
| Code is written and then directly executed. | Interpreter |
| One of the key features of python. | Python is not easy to learn |
| Which of the following are not true about Python? | Compiled |
| Guido Van Rossum invented what programming language. | Python |
| Java allows you to type commands one-at-a-time and see results. | False |
| Pybrain for advanced computing. | False |
| Python code is written and then directly executed by an ____________. | Interpreter |
| Python was invented in Netherlands. | True |
| Python is free and open source. | True |
| Different modules can use the same names without causing name clashes. | Namespace |
| Allows users to launch applications and manage conda packages, environments and channels without using command-line commands. | Anaconda Navigator |
| What is the meaning of this symbol >>> in Python? | prompt |
| Block structure are different modules can use the same names without causing name clashes. | False |
| Allows you to type commands one-at-a-time and see results. | Python interpreter |
| Features in Python where you don’t have to remember the system architecture or to manage the memory. | High Level Language |
| Python is not a powerful language. | False |
| Python supports object-oriented language. | True |
| Which of the following are not true in Python? | Python is not easy to learn |
| Which country Python Programming was invented? | Netherlands |
| Python code is written and then directly executed by an interpreter. | True |
| Python type commands into interpreter and see immediate results. | True |
| Import Statement is used to import code from modules that are part of a standard Python distribution. | True |
| In 1989, Python programming was invented. | True |
| Python can run on a wide variety of hardware platforms. | Portable ?? |
| Namespace is used to import code from modules that are part of a standard Python distribution. | False |
| Python is not open source. | False |
| Python programming language is not portable. | False |
| An integrated development environment (IDE) from Microsoft. | Visual Studio |
| There are two ways of using Python to run your program - using the interactive interpreter prompt or using a _______ file. | source |
| Python shell is the great way to get started with Python. | True |
| The source code of python is converted into an immediate form. | bytecode |
| What is immediate form? | bytecode |
| What programming language is elegant in syntax and dynamic typing. | Python |
| It is a code written in a scripting language. Group of answer choices program source script compilation | Script |
| Numpy for scientific computation. | True |
| MOD 2 | |
| Float is positive or negative whole numbers. | False Float can be positive or negative decimal numbers, not whole numbers. |
| Integer numbers are identified as real part and imaginary part. | False Integers are whole numbers (positive, negative, or zero) and do not have real and imaginary parts |
| What is the output of the given python script: type((9,10,11)) | <class ‘tuple’> Because it is not a string (no quotes), not a list (no square brackets), and not a dictionary (no key–value pairs), Python identifies it as a tuple. |
| An unordered collection of data in a key:value pair form. | Dictionary Because only a dictionary stores data as key:value pairs in an unordered collection. |
| What is the output of the given python script: type(‘hello’) | <class ‘str’> |
| Integer is positive or negative whole numbers. | True |
| A Tuple object is an ordered collection of one or more data items, not necessarily of the same type, put in square brackets. | False Tuples are ordered collections, but they are enclosed in parentheses, not square brackets. |
| Positive or negative whole numbers (without a fractional part). | Integer |
| What is the output of the given python script: type(“abc”) | <class ‘str’> |
| What is the output of the given python script: type(3.45) | <class ‘float’> Because 3.45 has a decimal point, Python recognizes it as a float |
| Given the code below: x = 20 y = 25 print (x == y) What will be the output? | False Because x == y checks if 20 equals 25, which is not true. |
| What operators are used with numeric values to perform common mathematical operations? | Arithmetic |
| Arithmetic operators are used with numeric values to perform common mathematical operations. | True |
| Which of the following operators does not belong to the group? | Compound Because compound operators (like +=, -=) are different from bitwise, comparison, and membership operators, which are used for logical or relational checks rather than direct assignment. |
| Given the following code: a = 1 b = 2 c = 3 d = 4 x = a + b * c - d What will be the value of x when this code is executed? | 3 |
| Given the code below: x = 10 y = 10 x is y What will be the output? | True In Python, is checks if two variables refer to the same object in memory, and small integers like 10 are cached, so x and y point to the same object. |
| Syntax error is type of error where the Python could not figure out how to read your program. | True |
| Python supports many operators for combining data objects into expressions. | True |
| What is the output given the following python script. >>> 3 + 2 ** 3 | 11 **- raise to the power of >>> prompt |
| Operators are special symbols that designate that some sort of computation should be performed. | True |
| If statement execute a set of statements as long as a condition is true. | True Because an if statement runs the indented code only when its condition evaluates to True. |
| Given the code below: i=2 while i < 10: print(i, end =' ', flush = True) i += 1 What will be the output? | 23456789 |
| While loop statement execute a set of statements as long as a condition is true. | True Because a while loop keeps executing its block of code repeatedly until the condition becomes false. |
| x=9 if x == 10: print ("X equals 10.") elif x == 9: print ("X equals 9.") else: print ("X equals something else.") print ("This is outside 'if'.") | X equals 9. This is outside ‘if’. In Python, the line print ("This is outside 'if'.") prints because of indentation. |
| Given the code below: x=12 if x == 10: print ("X equals 10.") elif x == 9: print ("X equals 9.") else: print("X equals is something else.") print("This is outside 'if'.") | X equals something else. This is outside ‘if’. |
| The loop statement is used to check a condition. | False Because a loop statement is used to repeat a set of statements, not just to check a condition (though it may use a condition to decide when to stop). |
| Given the code below: i=1; j = 1 while i < 8: print(j, end =' ', flush = True) i += j j = i - j What will be the output? | 1123 |
| Given the code below: for i in range(1,10): if i%2: continue print(i, end=' ', flush=True) What will be the output? | 2468 for i in range(1, 10): → i takes values from 1 to 9. if i % 2: → checks if i is odd (remainder when divided by 2 is 1). continue → skips the rest of the loop for odd numbers. print(i, end=' ', flush=True) → only executes for even numbers. |
| How many choices are possible when using a single if-else statement? | 2 Because a single if-else statement has two possible outcomes: the if block runs if the condition is true, and the else block runs if the condition is false. |
| Objects have fields that can be changed. | Mutable Because mutable objects (like lists or dictionaries) have fields or values that can be changed after creation. |
| Dictionary an unordered collection of data in a key:value pair form. | True Because a dictionary in Python is an unordered collection where data is stored as key:value pairs. |
| Number as identified as real part and imaginary part. | Complex |
| An ordered collection of one or more data items, not necessarily of the same type, put in parentheses. | Tuple |
| Strings are immutable. | True |
| Complex numbers are identified as real part and imaginary part. | True |
| Logical operators are used with numeric values to perform common mathematical operations. | False Because logical operators (and, or, not) are used to combine or invert Boolean values, not to perform mathematical operations on numbers. |
| What is the output given the following python script. >>> 30 - 6 * 3 | 12 |
| Assignment operators are used to compare two values. | False Because assignment operators (like =) are used to store a value in a variable, not to compare values. |
| Given the code below: x = 20 y = 25 print (x >= y) What will be the output? | False |
| Given the code below: x = 10 x% = 5 print (x) What will be the output? | 0 |
| What is the output given the following python script: >>> 10%2 | 0 |
| Given the code below: x = 5 x* = 7 print (x) | 35 |
| Function returns a list of numbers from 0 up to but not including the number pass to it. | range() Because the range() function returns a sequence of numbers from 0 up to, but not including, the number passed to it. |
| The range() function returns a list of numbers from 0 up to but not including the number pass to it. | True |
| num = 21 if num == 20: print ("You win ") else: print ("You lose ") print ("the prize.") | You lose the prize. |
| Continue statement stop the loop before it has looped through all the items. | False Because the continue statement does not stop the loop; it skips the current iteration and moves to the next one. |
| Given the code below: x=3 while i < 8: print(x, end =' ', flush = True) x += 1 What will be the output? | 34567 |
| In a Python, a control structure: | Directs the order of execution of the statements in the program |
| Statement iterates over a sequence of objects. | for |
| Given the code below: for i in range(1,8): if i%2: continue print(i, end=' ', flush=True) What will be the output? | 246 The reason 8 is not included is because of how range(1, 8) works in Python: The syntax is range(start, stop) It includes start but stops before stop So range(1, 8) generates: 1, 2, 3, 4, 5, 6, 7 → 8 is excluded |
| Given the code below: for i in range(1, 4): print(i, end=' ', flush=True) What will be the output? | *** 123 |
| Float is any real number with a floating point representation in which a fractional component is denoted by a decimal symbol or scientific notation. | True |
| What is the output of the given python script: type(2+7j) | <class ‘complex’> 2 + 7j is a complex number in Python, with a real part 2 and an imaginary part 7j. |
| Data with one of two built-in values True or False. | Boolean |
| Comments explain important decision. | True |
| An ordered collection of one or more data items, not necessarily of the same type, put in square brackets. | List Because a list is an ordered collection of items, possibly of different types, and is enclosed in square brackets []. |
| A sequence of character data. | String |
| There are three distinct numeric types: integers, floating point numbers, and complex numbers. | True |
| Integer are sequence of character data. | False String |
| Which of the following is not belong in immutable objects? | List Because lists are mutable objects (their elements can be changed), while Boolean, String, and Integer are immutable. |
| In Python statement x = a + 3 - b: | expression |
| Assignment operators are used with numeric values to perform common mathematical operations. | False Because assignment operators (like =, +=, -=) are used to store or update values in variables, not to perform mathematical operations by themselves. |
| What is the output given the following python script: >>> 3**3 | 27 The ** operator is exponentiation, so 3**3 = 3 × 3 × 3 = 27. |
| Given the code below: x = 20 y = 25 print (x <= y) What will be the output? | True |
| Operands are special symbols that designate that some sort of computation should be performed. | False Because operands are the values or variables that operators work on, while operators are the symbols that perform the computation. |
| Membership operators are used to test if a sequence is presented in an object. | True Because membership operators (in and not in) check whether a value exists in a sequence or collection. |
| Given the code below: x = [“one”, “two”, “three”] print (“three” in x) What will be the output? | True The expression "three" in x checks if the string "three" exists in the list x = ["one", "two", "three"], which it does, so the result is True. |
| num = 25 if num < 20: print ("Under ") else: print ("Over ") print ("the limit.") | Over the limit. |
| The range() function defaults to increment the sequence by 1. | True Because in Python, range(start, stop) increments by 1 by default if no step is specified. |
| Statement is used to check a condition. | if |
| Given the code below: i=1 while i < 5: print(i, end =' ', flush = True) i += 1 What will be the output? | 1234 |
| Given the code below: x=0 while (x < 80): x += 2 print(x, end =' ', flush = True) What will be the output? | 80 |
| Given the code below: x=0 while (x < 80): x += 2 print(x, end =' ', flush = True) What will be the output? | 80 |
| Break statement stop the loop before it has looped through all the items. | True |
| A list object is an ordered collection of one or more data items, not necessarily of the same type, put in parentheses. Group of answer choices True False | False |
| Float are a subtype of integers. | False Because floats are separate numeric types that represent numbers with decimals, not a subtype of integers. |
| String is any real number with a floating point representation in which a fractional component is denoted by a decimal symbol or scientific notation. | False Because that definition describes a float, not a string. A string is a sequence of characters enclosed in quotes. |
| A list value is a collection of one or more characters put in single or double quotes. | False Because a list is a collection of items of any type (numbers, strings, other lists, etc.) enclosed in square brackets [], not just characters in quotes. |
| Python has an in-built function type() to ascertain the data type of a certain value. | True Because Python’s built-in type() function is used to determine the data type of a value or variable. |
| What is the output given the following python script. >>> 10 / 2 + 2 * 3 | 11.0 Division first: 10 / 2 = 5.0 Multiplication next: 2 * 3 = 6 Addition: 5.0 + 6 = 11.0 |
| What operators are used to test if a sequence is presented in an object? | Membership |
| Given the code below: x = [“one”, “two”, “three”] print (“four” in x) What will be the output? | False |
| Bitwise operators are used to compare (binary) numbers. | True Because bitwise operators (&, |, ^, ~, <<, >>) perform operations on the binary representation of integers. |
| Operands are the values that an operator act. | True |
| Given the code below: x = 20 y = 25 print (x != y) What will be the output? | True |
| In Python statement x = a + 3 - b: a and b are: | operands |
| Logical operators are used to test if a sequence is presented in an object. | False |
| The if statement iterates over a sequence of objects. | False Because an if statement checks a condition and executes code only if the condition is true; it does not iterate over a sequence. Iteration is done using loops like for or while. |
| Break statement stop the current iteration of the loop, and continue with the next. | False Because the break statement terminates the entire loop immediately, whereas continue skips the current iteration and moves to the next one. |
| Given the code below: for i in range(1, 10, 2): print(i, end=' ', flush=True) What will be the output? | 1 3 5 7 9 *** |
| xrange() returns an iterator that provides the same functionality more efficiently. | True |
| String are sequence of character data. | True |
| What is the output of the given python script: type(‘abc’) | <class ‘str’> |
| What is the output of the given python script: type(42.65) | <class ‘float’> |
| Immutable objects have fields that can be changed. | False |
| A sequence of operands and operators. | Expression |
| String literals may be delimited using either single or double quotes. | True |
| What operators are used to compare two values? | Comparison |
| Given the code below: x = 23 x+ = 5 print (x) What will be the output? | 28 |
| The range() function defaults to increment the sequence by 2. | False, by 1 |
| Given the code below: for i in range(1, 6): print(i, end=' ', flush=True) | 12345 |
| Statement stop the loop before it has looped through all the items. | break |
| The if statement is used to check a condition. | True |
| Given the code below: for i in range(1, 20, 4): print(i, end=' ', flush=True) What will be the output? | 1591317 |
| Given the code below: for i in range(-2, -5, -1): print(i, end=' ', flush=True) What will be the output? | -2-3-4 |