Organizer: Cisco, Network Academy, Python Institute.
About the Course
- Python Essentials 1- This course is part of the Learning Collections – Cisco Python Essentials Course Certificate.
- Learn fundamental concepts of computer programming and start building coding skills with the Python programming language.
- Self-paced learning icon, Self-Paced Online: Learn online at your own pace
- Instructor-led learning icon
- Instructor-Led: Learn with an academy English (English)
- Available Languages
- العربية, English, Magyar Pols, Português, Український
- Free Course
- Duration: 30 Hours
- Level: Beginner
- Lab: 30 Labs
- Delivery Type: Self-paced
- Achievements: Badges you can earn in this course / Get Cisco Verified Certificate
- Skills You Will Learn: Design, Develop, and Debug Scripts, Computer Programming, Procedural Programming, Python, Basic Python Programming, Algorithmic Thinking, Best Practices in Programming, Entry-level, Analytical Thinking.
Here’s what you will learn:
- PE1: Module 1. Introduction to Python and Computer Programming
- PE1: Module 2. Python Data Types, Variables, Operators, and Basic I/O Operations
- PE1: Module 3. Boolean Values, Conditional Execution, Loops, Lists and List Processing, Logical and Bitwise Operations
- PE1: Module 4. Functions, Tuples, Dictionaries, Exceptions, and Data Processing
- Python Essentials 1 (PE1) Course Final Exam
- PCEP – Certified Entry-Level Python Programmer Certification Exam
Apply Link
Used by startups and tech giants like Google, Facebook, Netflix, and more, Python offers you endless possibilities for creating small and large-scale software projects. User-friendly with easy-to-read code, Python is a great first programming language to learn and requires no prior programming knowledge. Python skills open you up to careers in almost any industry and are required if you want to continue to more advanced, higher paying software development and engineering roles such as software engineer, systems administrator, and security engineer.
In this course, you will learn in-demand skills such as how to design, develop, and improve computer programs, methods for analyzing problems using programming, programming best practices, and more. The course also prepares you for the PCEP – Certified Entry-Level Python Programmer certification (Exam PCEP-30-0x).
100% Correct Answers Available Here
Question 1. What is the output of the following snippet?
my_list = [1, 2]
for v in range(2):
my_list.insert(-1, my_list[v])
print(my_list)
[2, 1, 1, 2]
[1, 2, 1, 2]
[1, 1, 1, 2]
[1, 2, 2, 2]
Question 2. The meaning of a positional argument is determined by:
its value
its position within the argument list
its connection with existing variables
the argument’s name specified along with its value
Question 3. Which of the following sentences are true about the code? (Select two answers)
nums = [1, 2, 3]
vals = nums
vals is longer than nums
nums has the same length as vals
nums and vals are different names of the same list
nums and vals are different lists
Question 4. An operator able to check whether two values are not equal is coded as:
!=
not ==
<>
=/=
Question 5. The following snippet:
def function_1(a):
return None
def function_2(a):
return function_1(a) * function_1(a)
print(function_2(2))
will cause a runtime error
will output 2
will output 4
will output 16
Question 6. The result of the following division:
1 // 2
is equal to 0.0
is equal to 0
is equal to 0.5
cannot be predicted
Question 7. The following snippet:
def func(a, b):
return b ** a
print(func(b=2, 2))
is erroneous
will output 2
will output None
will output 4
Question 8. What value will be assigned to the x variable?
z = 0
y = 10
x = y < z and z > y or y < z and z < y
False
0
1
True
Question 9. Which of the following variable names are illegal and will cause the SyntaxError exception? (Select two answers)
In
print
for
in
Question 10. What is the output of the following snippet?
my_list = [x * x for x in range(5)]
def fun(lst):
del lst[lst[2]]
return lst
print(fun(my_list))
[0, 1, 4, 9]
[0, 1, 4, 16]
[1, 4, 9, 16]
[0, 1, 9, 16]
Question 11.What is the output of the following piece of code?
x = 1
y = 2
x, y, z = x, x, y
z, y, z = x, y, z
print(x, y, z)
1 1 2
1 2 1
1 2 2
2 1 2
Question 12. What will be the output of the following snippet?
a = 1
b = 0
a = a ^ b
b = a ^ b
a = a ^ b
print(a, b)
1 0
0 1
1 1
0 0
Question 13. What is the output of the following snippet?
def fun(x):
if x % 2 == 0:
return 1
else:
return 2
print(fun(fun(2)))
the code will cause a runtime error
2
1
2None
Question 14. Take a look at the snippet and choose the true statement:
nums = [1, 2, 3]
vals = nums
del vals[:]
the snippet will cause a runtime error
nums is longer than vals
vals is longer than nums
nums and vals have the same length
Question 15. What is the output of the following piece of code if the user enters two lines containing 3 and 2 respectively?
x = int(input())
y = int(input())
x = x % y
x = x % y
y = y % x
print(y)
2
0
1
3
Question 16. What is the output of the following piece of code if the user enters two lines containing 3 and 6 respectively?
y = input()
x = input()
print(x + y)
63
6
36
3
Question 17. What is the output of the following piece of code?
print(“a”, “b”, “c”, sep=”sep”)
asepbsepcsep
asepbsepc
a b c
abc
Question 18. What is the output of the following piece of code?
x = 1 // 5 + 1 / 5
print(x)
0
0.5
0.4
0.2
Question 19. Assuming that my_tuple is a correctly created tuple, the fact that tuples are immutable means that the following instruction:
my_tuple[1] = my_tuple[1] + my_tuple[0]
is illegal
may be illegal if the tuple contains strings
is fully correct
can be executed if and only if the tuple contains at least two elements
Question 20. What is the output of the following piece of code if the user enters two lines containing 2 and 4 respectively?
x = float(input())
y = float(input())
print(y ** (1 / x))
2.0
4.2
1.0
0.0
Question 21. What is the output of the following snippet?
dct = {‘one’: ‘two’, ‘three’: ‘one’, ‘two’: ‘three’}
v = dct[‘three’]
for k in range(len(dct)):
v = dct[v]
print(v)
two
(‘one’, ‘two’, ‘three’)
one
three
Question 22. How many elements does the lst list contain?
lst = [i for i in range(-1, -2)]
one
three
zero
two
Question 23. Which of the following lines correctly invoke the function defined below? (Select two answers)
def fun(a, b, c=0):
# Body of the function.
fun()
fun(0, 1, 2)
fun(b=0, a=0)
fun(b=1)
Question 24. What is the output of the following snippet?
def fun(x, y):
if x == y:
return x
else:
return fun(x, y-1)
print(fun(0, 3))
1
2
the snippet will cause a runtime error
0
Question 25. How many stars () will the following snippet send to the console? i = 0 while i < i + 2 : i += 1 print(““)
else:
print(“*”)
two
one
zero
the snippet will enter an infinite loop, printing one star per line
Question 26. What is the output of the following snippet?
tup = (1, 2, 4, 8)
tup = tup[-2:-1]
tup = tup[-1]
print(tup)
(4,)
4
(4)
44
Question 27. What is the output of the following snippet?
dd = {“1”: “0”, “0”: “1”}
for x in dd.vals():
print(x, end=””)
0 0
1 0
0 1
the code is erroneous (the dict object has no vals() method)
Question 28. What is the output of the following snippet?
dct = {}
dct[‘1’] = (1, 2)
dct[‘2’] = (2, 1)
for x in dct.keys():
print(dct[x][1], end=””)
(2,1)
(1,2)
21
12
Question 29. What is the output of the following snippet?
def fun(inp=2, out=3):
return inp * out
print(fun(out=2))
the snippet is erroneous and will cause SyntaxError
2
4
6
Question 30. How many hashes (#) will the following snippet send to the console?
lst = [[x for x in range(3)] for y in range(3)]
for r in range(3):
for c in range(3):
if lst[r][c] % 2 != 0:
print(“#”)
zero
done
three
nine
six
Question 31. What is the output of the following code if the user enters a 0?
try:
value = input(“Enter a value: “)
print(int(value)/len(value))
except ValueError:
print(“Bad input…”)
except ZeroDivisionError:
print(“Very bad input…”)
except TypeError:
print(“Very very bad input…”)
except:
print(“Booo!”)
1.0
Booo!
Bad input…
0.0
Very very bad input…
Very bad input…
Question 32. What is the expected behavior of the following program?
try:
print(5/0)
break
except:
print(“Sorry, something went wrong…”)
except (ValueError, ZeroDivisionError):
print(“Too bad…”)
The program will raise an exception handled by the first except block.
The program will cause a ValueError exception and output a default error message.
The program will cause a ZeroDivisionError exception and output a default error message.
The program will cause a ZeroDivisionError exception and output the following message: Too bad…
The program will cause a SyntaxError exception.
The program will cause a ValueError exception and output the following message: Too bad…
Question 33. What is the expected behavior of the following program?
foo = (1, 2, 3)
foo.index(0)
The program will cause an AttributeError exception.
The program will cause a ValueError exception.
The program will output 1 to the screen.
The program will cause a TypeError exception.
The program will cause a SyntaxError exception.
Question 34. Which of the following snippets shows the correct way of handling multiple exceptions in a single except clause?
A:
except (TypeError, ValueError, ZeroDivisionError):
# Some code.
B:
except TypeError, ValueError, ZeroDivisionError:
# Some code.
C:
except: (TypeError, ValueError, ZeroDivisionError)
# Some code
D:
except: TypeError, ValueError, ZeroDivisionError
# Some code.
E:
except (TypeError, ValueError, ZeroDivisionError)
# Some code.
F:
except TypeError, ValueError, ZeroDivisionError
# Some code.
A only
B and C
A and B
D and E
A and F
F only
A, C, and D
Question 35. What will happen when you attempt to run the following code?
print(Hello, World!)
The code will raise the ValueError exception.
The code will raise the AttributeError exception.
The code will raise the TypeError exception.
The code will raise the SyntaxError exception.