[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

1. With the for loop we can execute a set of statements

2 / 40

2. Python has a set of built-in methods that you can use on lists/arrays

3 / 40

3.

What is the value of the expression 100 / 25?

  1. 4
  2. 4.0
  3. 0
  4. 25

4 / 40

4. To write and execute code in python, we first need to install Python on our system.

5 / 40

5. Operators are used to perform operations on variables and values

6 / 40

6. What will be the output of the following Python code?

  1. d = {"john":40, "peter":45}
  2. d["john"]

a) 40
b) 45
c) “john”
d) “peter”

7 / 40

7. Python is an interpreted programming language

8 / 40

8.

Which of the following statement is a function call?

a. call sum( )

b. def sum( )

c. sum( )

d. function sum( )

9 / 40

9.

Which of the following statements assigns the value 25 to the variable x in Python:

  1. x ← 25
  2. x = 25
  3. x := 25
  4. int x = 25
  5. x << 25

10 / 40

10. Comparison operators are not  used to compare two values

11 / 40

11. Snake Case
Each word is separated by an underscore character:

12 / 40

12. Comments can’t be used to prevent execution when testing code.

13 / 40

13. Comments can be used to make the code more readable.

14 / 40

14. You can also use the remove() method to remove an element from the array

15 / 40

15. Indentation refers to the spaces at the beginning of a code line.

16 / 40

16.

 Select the correct example of complex datatype in Python

  1. 3 + 2j
  2. -100j
  3. 5j
  4. All of the above are correct

17 / 40

17. With the break statement we can stop the loop before it has looped through all the items

18 / 40

18. Python relies on indentation?

19 / 40

19. Python is a  high-level programming language.

20 / 40

20. Arrays are used to store multiple values in one single variable.

21 / 40

21. Python can be used on a server to create web applications?

22 / 40

22. Identity operators are used to compare the objects, not if they are equal, but if they are actually the same object, with the same memory location

23 / 40

23.

 ____________________ can be defined as a named group of instructions that accomplish a specific task when it is invoked/called.

a. Function

b. Datatype

c. Token

d. Operator

24 / 40

24. Python can be install on both  Linux and  Windows

25 / 40

25. Which term describes a loop that continues repeating without a terminating (ending) condition?

a) Infinite Loop

b) Conditional Loop

c) Unlimited Loop

d) Sequence Loop

26 / 40

26. Python can connect to database systems.

27 / 40

27. An example of an illegal character is a double quote inside a string that is surrounded by double quotes

28 / 40

28. The list’s remove() method only removes the first occurrence of the specified value.

29 / 40

29.

The function can be called in the program by writing function name followed by ____

a. [ ]

b. { }

c. ( )

d. None of the above

30 / 40

30. With the break statement we can stop the loop even if the while condition is true

31 / 40

31.

What is the data type of print(type(10))

32 / 40

32. You can also have multiple else statements on the same line:

33 / 40

33.

Following is an example of ___________________

sv = “csiplearninghub.com”

a. List

b. String

c. Dictionary

d. None of the above

34 / 40

34.

What will the below Python code will return?

If str1="save paper,save plants"str1.find("save")

A. It returns the first index position of the first occurance of “save” in the given string str1.
B. It returns the last index position of the last occurance of “save” in the given string str1.
C. It returns the last index position of the first occurance of “save” in the given string str1.
D. It returns the first index position of the first occurance of “save” in the given string str1.

35 / 40

35.

Which statement is correct?

A. List is immutable && Tuple is mutable
B. List is mutable && Tuple is immutable
C. Both are Mutable.
D. Both are Immutable

36 / 40

36. You can use the append() method to add an element to an array

37 / 40

37.  ________ in Python is a counter-controlled loop.

a) for

b) while

c) Both (a) and (b)

d) None of the above

38 / 40

38. You can use three double quotes only:

a = “””Lorem ipsum dolor sit amet,
consectetur adipiscing elit,
sed do eiusmod tempor incididunt
ut labore et dolore magna aliqua.”””
print(a)

39 / 40

39. Comments can be used to explain Python code.

40 / 40

40. Find and write the output of the following python code:

x = “abcdef”

i = “a”

while i in x:

print(i, end = ” “)

a) a

b) a a a a a a

c) a a a a a a … infinite times

d) Code will generate error

Exit



[hurrytimer id=”2250″]
[wooct_product]

Wrong shortcode initialized


You must log in to see your results.



Wrong shortcode initialized


There are no questions atteched yet.





[ays_quiz_leaderboard id=”Your_Quiz_ID” from=”Y-m-d H:i:sa” to=”Y-m-d H:i:s”]

Category:


Wrong shortcode initialized


[WATU 1]

You must log in to see your results.