[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

1. What keyword would you use to add an alternative condition to an if statement?

a) else if
b) elseif
c) elif
d) None of the above

2 / 40

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

3 / 40

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

4 / 40

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

5 / 40

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

6 / 40

6.

Which of the following is not a keyword in Python language?

  1. val
  2. raise
  3. try
  4. with

7 / 40

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

x = ['ab', 'cd']for i in x:    i.upper()print(x)

a) [‘ab’, ‘cd’]
b) [‘AB’, ‘CD’]
c) [None, None]
d) none of the mentioned

8 / 40

8. python has two primitive loop commands:

  • while loops
  • for loops

9 / 40

9. Find the output of the given Python program?

a, b, c = 1, 3, 5if a > 0:  if b < 2:    print("Hi")  elif c > 3:    print("Hello")else:  print("Know Program")

a) Hi
b) Hello
c) Know Program
d) Compiled Successfully, No Output.

10 / 40

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

11 / 40

11. During Installation Make sure to select both the checkboxes at the bottom .

12 / 40

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

13 / 40

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

14 / 40

14.

What will be the output of below Python code?

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

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

15 / 40

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

16 / 40

16. Which of the following is used to define a block of code in Python language?
a) Indentation
b) Key
c) Brackets
d) All of the mentioned

17 / 40

17. Python will give you an error if you skip the indentation

18 / 40

18. An array can hold many values under a single name

19 / 40

19. Which of the following is a Python tuple?
a) [1, 2, 3]
b) (1, 2, 3)
c) {1, 2, 3}
d) {}

20 / 40

20.

Choose the correct option with respect to Python.

A. Both tuples and lists are immutable.
B. Tuples are immutable while lists are mutable.
C. Both tuples and lists are mutable.
D. Tuples are mutable while lists are immutable.

21 / 40

21. Which of the following is the use of function in python?
a) Functions are reusable pieces of programs
b) Functions don’t provide better modularity for your application
c) you can’t also create your own functions
d) All of the mentioned

22 / 40

22. print() function is often used to output variables.

23 / 40

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

24 / 40

24. Python can connect to database systems.

25 / 40

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

26 / 40

26.

In a program, a function can be called ____________ times.

a. 2

b. 3

c. 5

d. Multiple times

27 / 40

27.

Following is an example of ___________________

sv = “csiplearninghub.com”

a. List

b. String

c. Dictionary

d. None of the above

28 / 40

28. Find the output of the following program segments:

for i in range(20,30,2):

print(i)

a) 20 22 24 26 28

b) 20

22

24

26

28

c) 20 22 24 26 28 30

d) 20

22

24

26

28

30

29 / 40

29. Variables that are created outside of a function

30 / 40

30. What is the output of the given below program?

if 1 + 3 == 7:    print("Hello")else:    print("Know Program")

a) Hello
b) Know Program
c) Compiled Successfully, No Output.
d) Error

31 / 40

31. Comments starts with a #

32 / 40

32. Extension of all Python  Programme are .py

33 / 40

33.

What is the value of the expression 100 / 25?

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

34 / 40

34. Camel Case
Each word, except the first, starts with a capital letter:

35 / 40

35.

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

36 / 40

36.

The most important object defined in NumPy is an N-dimensional array type called?

A. ndarray
B. narray
C. nd_array
D. darray

37 / 40

37.

 ____________________ 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

38 / 40

38.

 Select the correct example of complex datatype in Python

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

39 / 40

39. What is another word for ‘iteration’ ?

a) Selection

b) Assignment

c) Sequencing

d) Repetition

40 / 40

40. Python has syntax that allows developers to write programs with fewer lines than some other programming languages.

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.