[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

1. Is Python code compiled or interpreted?
a) Python code is both compiled and interpreted
b) Python code is neither compiled nor interpreted
c) Python code is only compiled
d) Python code is only interpreted

2 / 40

2. Python allows you to extract the values into variables.

3 / 40

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

4 / 40

4. Python is an interpreted programming language

5 / 40

5.

Function defined to achieve some task as per the programmer’s requirement is called a ___________

a. user defined function

b. library function

c. built in functions

d. All of the above.

6 / 40

6.

Following is an example of ___________________

sv = “csiplearninghub.com”

a. List

b. String

c. Dictionary

d. None of the above

7 / 40

7. Pip is  not a powerful package management system for Python software packages

8 / 40

8. What does the following code print?

x = -10if x < 0:    print("The negative number ",  x, " is not valid here.")print("This is always printed")
a.This is always printedb.The negative number -10 is not valid hereThis is always printedc.The negative number -10 is not valid here

9 / 40

9. When does the else statement written after loop executes?

a) When loop condition becomes false

b) When break statement is executed in the loop

c) else statement is always executed

d) None of the above

10 / 40

10. The len() method to return the length of an array

11 / 40

11.

In Python, a variable may be assigned a value of one type, and then later assigned a value of a different type:

  1. False
  2. True

12 / 40

12. You can use the pop() method to remove an element from the array

13 / 40

13. Which of the following is False regarding loops in Python?

a)Loops are used to perform certain tasks repeatedly.

b) while loop is used when multiple statements are to executed repeatedly until the given condition becomes true.

c) while loop is used when multiple statements are to executed repeatedly until the given condition becomes false.

d) for loop can be used to iterate through the elements of lists.

14 / 40

14. Which of the following is the correct extension of the Python file?

15 / 40

15. 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)

16 / 40

16.

What will be the output of below Python code?

str1="poWer"str1.upper()print(str1)

A. POWER
B. Power
C. power
D. poWer

17 / 40

17. 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

18 / 40

18. Bitwise operators are used to compare (binary) numbers

19 / 40

19. You can also have an else without the elif

20 / 40

20. Who developed Python Programming Language?

21 / 40

21. Comments starts with a #

22 / 40

22.

 Select the correct example of complex datatype in Python

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

23 / 40

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

24 / 40

24. Most recent major version of Python is Python 3

25 / 40

25. Comparison operators are not  used to compare two values

26 / 40

26. You have to use the same number of spaces in the same block of code, otherwise Python will give you an error

27 / 40

27. The length of an array is always one more than the highest array index.

28 / 40

28.

In the Python statement x = a + 5 – b:

a and b are ________a + 5 - b is ________
  1. terms, a group
  2. operators, a statement
  3. operands, an expression
  4. operands, an equation

29 / 40

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

30 / 40

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

31 / 40

31. Python  was created by Guido van Rossum, and released in 1999.

32 / 40

32.

What will be the output of below Python code?

str1="Information"print(str1[2:8])

A. format
B. formatio
C. orma
D. ormat

33 / 40

33. The for loop does not require an indexing variable to set beforehand

34 / 40

34.

Which of the following statement will execute in last?

def s(n1): #Statement 1      print(n1) #Statement 2n2=4 #Statement 3s(n2) #Statement 4

a. Statement 1

b. Statement 2

c. Statement 3

d. Statement 4

35 / 40

35.

Which of the following creates a tuple?

A. tuple1=(“a”,”b”)
B. tuple1[2]=(“a”,”b”)
C. tuple1=(5)*2
D. None of the above

36 / 40

36. Arithmetic operators are used with numeric values to perform common mathematical operations

37 / 40

37. Python can be treated in a procedural way, an object-oriented way or a functional way.

38 / 40

38.

 ____________________ 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

39 / 40

39.

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

40 / 40

40.

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.

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.