[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

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

2 / 40

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

i = 1while True:    if i%3 == 0:        break    print(i)     i + = 1

a) 1 2
b) 1 2 3
c) error
d) none of the mentioned

3 / 40

3. Python is an interpreted programming language

4 / 40

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

5 / 40

5. Can we write if/else into one line in python?

a) Yes
b) No
c) if/else not used in python
d) None of the above

6 / 40

6.

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

7 / 40

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

8 / 40

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

9 / 40

9. Python can be used to handle big data and perform complex mathematics.

10 / 40

10. The elif keyword is pythons way of saying “if the previous conditions were not true, then try this condition”.

11 / 40

11.

Which keyword is used to begin the definition of a function?

a. Define

b. DEF

c. def

d. Def

12 / 40

12. X wants to allow the program to repeatedly ask the user to enter their Choice if it does not equal the Answer. Which loop option should X use?

a) while Choice == Answer:

Choice = input()

b) while Choice != Answer:

Choice = input()

c) while Answer != Choice:

Choice = input()

d) while Answer =! Choice:

Choice = input()

 

13 / 40

13.

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

14 / 40

14. A loop block in python starts with a –

a) ; (semicolon)

b) , (comma)

c) : (colon)

d) # (hash)

15 / 40

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

16 / 40

16. Which of the following character is used to give single-line comments in Python?
a) //
b) #
c) !
d) /*

17 / 40

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

18 / 40

18.

What is the value of the expression 100 / 25?

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

19 / 40

19.

Which function overloads the >> operator?

  1. more()
  2. gt()
  3. ge()
  4. None of the above

20 / 40

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

21 / 40

21.

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

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

22 / 40

22.

Which is the correct operator for power(xy)?

  1. X^y
  2. X**y
  3. X^^y
  4. None of the mentioned

23 / 40

23. Python can be install on both  Linux and  Windows

24 / 40

24. break in Python is used ______________

a) To restart a loop

b) Terminate a loop

c) To jump in between the loop

d) None of the above

25 / 40

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

26 / 40

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

27 / 40

27. Python is a  high-level programming language.

28 / 40

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

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

a) Hi
b) Know Program

c)
Hi
Hello

d)
Know Program
Hello

29 / 40

29. A for loop is used for iterating over a sequence (that is either a list, a tuple, a dictionary, a set, or a string).

30 / 40

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

31 / 40

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

32 / 40

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

33 / 40

33.

Python considered the character enclosed in triple quotes as String.(T/F)

a. True

b. False

34 / 40

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

35 / 40

35. The format() method takes unlimited number of arguments

36 / 40

36.

 Select the correct example of complex datatype in Python

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

37 / 40

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

38 / 40

38.

Following is an example of ___________________

sv = “csiplearninghub.com”

a. List

b. String

c. Dictionary

d. None of the above

39 / 40

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

40 / 40

40. You have to use the same number of spaces in the same block of code, otherwise Python will give you an 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.