click below
click below
Normal Size Small Size show me how
IT0011 FA2
| Question | Answer |
|---|---|
| What is the output of the given python script: type(42.65) | <class ‘float’> |
| What is the output of the given python script: type(2+7j) | <class ‘complex’> |
| A Tuple object is an ordered collection of one or more data items, not necessarily of the same type, put in parentheses. | T |
| Strings are immutable. | F |
| Number as identified as real part and imaginary part. | COMPLEX |
| Python supports many operators for combining data objects into expressions. | T |
| Syntax error is type of error where the Python could not figure out how to read your program. | T |
| Membership operators are used to test if a sequence is presented in an object. | F |
| A-1;B=2;C=3;D=4 X=A+B*C-D What will be the value of x? | 3 |
| Membership operators are used to compare (binary) numbers. | F |
| The range() function defaults to increment the sequence by 2. | F |
| num=21 if num==20: print("youwin") else: print('you lose') print("theprize.") | You lose the prize. |
| Break statement stop the current iteration of the loop, and continue with the next. | f |
| The if statement iterates over a sequence of objects. | F |
| Statement stop the loop before it has looped through all the items. | break |
| 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'.") What will be the output? | X equals something else. This is outside ‘if’. |
| Statement is used to check a condition. | if |
| The range() function returns a list of numbers from 0 up to but not including the number pass to it. | T |
| 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 |
| x=9 if x==10: print("x=10") elif x==9: print('x=9') else: print('x=smtelse') print("thisisoutside'if'")s | X equals 9. This is outside ‘if’. |
| A collection of one or more characters put in single or double quotes. | string |
| Positive or negative whole numbers (without a fractional part). | Integer |
| 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 | f |
| What is the correct symbol of comments in Python? | # |
| What is the output of the given python script: type([3,4,5]): | list |
| Given the code below: x = [“one”, “two”, “three”] print (“three” in x) What will be the output? | True |
| Python supports many operators for combining data objects into expressions. | T |
| Given the code below: x = 10 y = 10 x is y What will be the output? | T |
| What is the output given the following python script. >>> 3 + 2 ** 3 | 11 |
| Membership operators are used to compare the objects, not if they are equal, but if they are actually the same object. | F |
| Continue statement stop the loop before it has looped through all the items. | F |
| The if statement iterates over a sequence of objects. | F |
| num=21 if num!=20: print("youwin") else: print('you lose') print("theprize.") | You win the prize |
| The range() function returns a list of numbers from 0 up to but not including the number pass to it. | T |
| Given the code below: i=1; j = 1 while i < 10: print(j, end =' ', flush = True) i += j j = i - j What will be the output? | 11235 |
| Break statement stop the loop before it has looped through all the items. | T |
| The if statement is used to check a condition. | T |
| If statement execute a set of statements as long as a condition is true. | F |
| A list object is an ordered collection of one or more data items, not necessarily of the same type, put in parentheses. | F |
| String are sequence of character data. | T |
| Any real number with a floating point representation in which a fractional component is denoted by a decimal symbol or scientific notation. | FLOAT |
| A sequence of operands and operators. | EXPRESSION |
| Arithmetic operators are used with numeric values to perform common mathematical operations. | T |
| Given the code below: x = [“one”, “two”, “three”] print (“four” in x) What will be the output? | false |
| Logical operators are used with numeric values to perform common mathematical operations. | F |
| What is the output given the following python script: >>> 10%2 | 0 |
| for i in range(1, 10, 2): print(i, end=' ', flush=True) | 13579 |
| What signifies the end of a statement block or suite in Python? | A line that is indented less than the previous line |
| for i in range(1, 5): print(i, end=' ', flush=True) | 1 2 3 4 |
| For loop statement execute a set of statements as long as a condition is true. | f |
| Statement stop the loop before it has looped through all the items. | break |
| How many choices are possible when using a single if-else statement? | 2 |
| Function returns an iterator that provides the same functionality more efficiently. | xrange() |
| What is the output of the given python script: type((9,10,11)) | <class ‘tuple’> |
| There are three distinct numeric types: integers, floating point numbers, and complex numbers. | t |
| An unordered collection of data in a key:value pair form. | Dict |
| Operators are the values that an operator act. | F |
| Python supports many operators for combining data objects into expressions. | t |
| Given the code below: for i in range(-2, -5, -1): print(i, end=' ', flush=True) What will be the output? | -2-3-4 |
| The range() function defaults to increment the sequence by 1. | T |
| Continue statement stop the loop before it has looped through all the items. | F |
| For loop statement execute a set of statements as long as a condition is true. | F |
| Statement execute a set of statements as long as a condition is true. | while |
| Statement stop the loop before it has looped through all the items. | Break |
| Break statement stop the current iteration of the loop, and continue with the next. | F |
| The loop statement is used to check a condition. | F |