Professional Documents
Culture Documents
PE2 Python Essentials 2 Part 2 Summary Test Answers Full 100%
PE2 Python Essentials 2 Part 2 Summary Test Answers Full 100%
PE2 Python Essentials 2 Part 2 Summary Test Answers Full 100%
ORG/)
ExamTube
Search...
(https://examtube.org/)
2024/)
This is Cisco NetAcad SkillsForAll PE2: Python Essentials 2 – Part 2 normally controlled by the
Northbridge part of the chipset?
Summary Test and PE2 Course Final Exam Answers full 100% in 2023 and
(Choose two.)
2024. All answers have been verified by experts.
(https://examtube.org/which-
two-activities-are-normally-
1. The following code:
controlled-by-the-northbridge-
part-of-the-chipset-choose-
two/)
x = "\\\\"
Which of the following is not a
print(len(x))
valid command for variable
declaration?
(https://examtube.org/which-of-
will print 1
the-following-is-not-a-valid-
will print 2 command-for-variable-
will cause an error declaration/)
will print 3 A new environment variable can
2. What information can be read using the uname be exported and assigned a
value with a single command.
function provided by the os module? (Select two
(https://examtube.org/a-new-
answers)
environment-variable-can-be-
exported-and-assigned-a-value-
import os with-a-single-command/)
Which of the following is not a
os.mkdir('pictures')
valid variable name?
os.chdir('pictures') (https://examtube.org/which-of-
print(os.getcwd()) the-following-is-not-a-valid-
variable-name/)
Shell variables are case
Last login date. sensitive. True or False?
Current path (https://examtube.org/shell-
Operating system name variables-are-case-sensitive-
Hardware identifier true-or-false/)
0
Recent Comments
True
1 Kuba on NDG Linux Essentials
False 2.21 | Creating Users and
5. What is the excepted result of the following code? Groups Module 16 | Chapter 16
Exam Answers Full 100%
(https://examtube.org/ndg-
from datetime import timedelta linux-essentials-2-21/ndg-linux-
essentials-2-21-creating-users-
delta = timedelta(weeks = 1, days = 7, hours
and-groups-module-16-chapter-
print(delta * 2)
16-exam-answers-full-
100/#comment-16)
mod:fun()
mod::fun()
fun()
mod.fun()
9. What output will appear after running the following
snippet?
import random
#
# Insert lines of code here.
#
print(a, b,
6 82 0
a = random.randint(0, 100)
b = random.randrange(10, 100, 3)
c = random.choice((0, 100, 3))
a = random.randrange(10, 100, 3)
b = random.randint(0, 100)
c = random.choice((0, 100, 3))
a = random.randint(0, 100)
b = random.choice((0, 100, 3))
c = random.randrange(10, 100, 3)
11. What is the expected result of the following code?
o days
0 days, 11:27:22
11:27:22
11 hours, 27 minutes, 22 seconds
12. What is the expected result of the following code?
import calendar
calendar.setfirstweekday(calendar.SUNDAY)
print(calendar.weekheader(3))
Su Mo Tu We Th We Fr Sa
Sun Mon Tue Wed Thu Fri Sat
Tu
Tue
13. what is the expected result of executing the following
code?
class A:
class I:
def __init__(self):
self.s = 'abc'
self.i = 0
def __init__(self):
return self
def __next__(self):
if self.i == len(self.s):
raise StopIteration
v = self.s[self.i]
self.i +=1
return v
for x in I():
print(x, end='')
py
pyb
pc
pyc
17. Which pip command would you use to uninstall a
previously install package?
try:
raise Exception(1, 2, 3)
except Exception as e:
print(len(e.args))
try:
raise Exception
except BaseException:
print("a")
except Exception:
print("b")
except:
print("c")
a
An error message
1
20. What is the expected result of executing the following
code?
class A:
pass
class B(A):
pass
class C(B):
pass
print(issubclass(A, C))
print(float("1.3"))
will print 13
print(chr(ord('p) + 2))
will print:
q
s
r
t
24. If there are more than one except: branch after
the try: clause, we can say that:
class Class:
def __init__(self, vla = 0):
pass
object = Class(1)
object = Class(None)
object = Class(1, 2)
object = Class()
26. What is the expected result of the following snippet?
try:
raise Exception
except:
print("c")
except BaseException:
print("a")
except Exception:
print("b")
1
b
a
27. What is the expected result of the following code?
def my_fun(n):
s = '+'
for i in range(n):
s += s
yield s
for x in my_fun(2):
print(x, end='')
[1, 9]
foo = list(filter(lambda x: x % 2,
numbers))
foo = list(filter(lambda x: x / 2, numbers))
foo = list(map(lambda x: x % 2, numbers))
foo = list(map(lambda x: x // 2, numbers))
29. What is the expected result of executing the following
code?
def o(p):
def q():
return '*' * p
return q
r = o(1)
s = o(2)
print(r() + s())
the keyboard
the printer
a null device
the screen
32. What will be the output of the following code, located
in the p.py file?
print(__name__)
main
p.py
__main__
__p.py__
33. Assuming that the open() invocation has gone
successfully, the following snippet:
will:
q = s.read(1)
will read:
import os
os.mkdir('pictures')
os.chdir('pictures')
print(os.getcwd())
# file a.py
print("a", end='')
# file b.py
import a
print("b", end='')
# file c.py
print("c", end='')
import a
import b
cab
cab
abc
bac
38. What is the expected result of executing the followinf
code?
class A:
def __init__(self):
pass
a = A(1)
print(hasattr(a, 'A'))
x = " \\"
print(len(x))
will print 1
will print 3
will print 2
will cause an error
40. Which of the following commands would you use to
check pip ‘s version? (Select two answers)
pip version
pip --version
pip–version
pip3 --version
5
Article Rating
Subscribe
Login (https://examtube.org/wp-login.php?
redirect_to=https%3A%2F%2Fexamtube.org%2Fpe2-python-essentials-
2%2Fpe2-python-essentials-2-part-2-summary-test-answers-full-100%2F)
0 COMMENTS