Structured Programming (Python) Flashcards
Python can be easily integrated to C++, DOM, Active X and COBRA. (T/F)
FALSE* (COM*)
*Python is _____________ application.
INTERPRETED
Python uses curly brackets like C, C++ and Java to denote delimit blocks. (T/F)
FALSE, WHITESPACES
Python version 3.6 was release 2015. (T/F)
FALSE, 2016 (Dec. 22)
Python version 3.5 was release 2014. (T/F)
FALSE, 2015 (Sep. 12)
Python uses duck typing and has typed objects but untyped variable names. (T/F)
TRUE
Python has fewer ________ constructions than other languages.
SYNTACTICAL
It uses ________ keywords frequently whereas the other languages use punctuations.
ENGLISH
Python can run on a wide variety of hardware platforms and has the same interface on all platforms. (T/F)
TRUE
Python is similar to the following PL _____________.
JAVA AND C
All keywords in Python are in _________.
NONE OF THE MENTONED
What is the answer to this expression, 22 % 3 is?
1
Which of the following is not a keyword?
Group of answer choices
assert
nonlocal
pass
eval
EVAL
What is the maximum possible length of an identifier?
ANY LENGTH
Operators with the same precedence are evaluated in which manner?
LEFT TO RIGHT
Mathematical operations can be performed on a string. (T/F)
FALSE
There are how many keywords in Python 3.x interpreter.
33
> > > symbol is knows as.
(Python) Interactive Shell
What is the order of precedence in python? i) Parentheses ii) Exponential iii) Multiplication iv) Division v) Addition vi) Subtraction
i,ii,iii,iv,v,vi
Which one of the following has the highest precedence in the expression?
Group of answer choices
Addition
Multiplication
Exponential
Parenthesis
Parenthesis
The syntax of methods is instance.method(Object). (T/F)
FALSE, instance.method(argument)
Python version 3.4 was release March 2014. (T/F)
TRUE
Unnamed functions are implemented using lambda expressions (T/F)
TRUE
Python does not allow chained comparison. (T/F)
FALSE, DOES ALLOW
Python’s bulk of the library is very portable and cross-platform compatible on UNIX, Windows, and Macintosh. (T/F)
TRUE
Python allows programmer to define their own type using def function, which are not use for object-oriented programming. (T/F)
FALSE, “Python allows programmers to define their own types
using classes, which are most often used for object-oriented
programming.”
Which of the following is an invalid variable?
Group of answer choices
my_string_1
1st_string
hjt
_a
1st_string (cant start with a number)
Which one of the following has the same precedence level?
Group of answer choices
Multiplication, Division, Addition and Subtraction
Addition and Multiplication
Addition and Subtraction
Multiplication, Division and Addition
Addition and Subtraction
Which of the following is true for variable names in Python?
Group of answer choices
underscore and ampersand are the only two special characters allowed
all private members must have leading and trailing underscores
none of the mentioned
unlimited length
unlimited length
The value of the expressions 4/(3(2-1)) and 4/3(2-1) is the same. (T/F)
TRUE (BOTH ARE 4/3)
What will be the value of the following Python expression? 4 + 3 % 5
7
What will be the value of x in the following Python expression? x = int(43.55+2/2)
44
What will be the value of the following Python expression? float(4+int(2.39)%2)
4.0
What is the answer to this expression, 22 % 3 is?
1
What is the value of the following expression? 2+4.00, 2**4.0?
6.0 16.0
The expression 223 is evaluates as: (22)3. (T/F)
FALSE (DIFFERENT ANSWERS, 256 AND 64 RESPECTIVELY)
Is a high-level, interpreted, interactive and object-oriented scripting language.
PYTHON
Evaluate the expression given below if A = 16 and B = 15. A % B // A
0
What symbol was introduce in Python 3.5 known as infix operator?
@
What will be the value of X in the following Python expression? X = 2+9((312)-8)/10
27.2
Which of the following expressions results in an error?
Group of answer choices
float(‘10’)
int(’10.8’)
int(‘10’)
int(’10.8’)
What will be the value of the following Python expression?4+2**5//10
7
What is the output of this expression, 3*1**3?
3
What will be the output of the following Python expression? print(4.00/(2.0+2.0))
1.0
Which of the following is not a keyword?
a) eval b) assert c) nonlocal d) pass
eval