[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

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

2 / 40

2. Find the output of the given Python program?

a = 25if a < 15:    print("Hi")if a <= 30:    print("Hello")else:    print("Know Program")

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

3 / 40

3. The else keyword catches anything which isn’t caught by the preceding conditions.

4 / 40

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

5 / 40

5.

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

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

6 / 40

6.

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

7 / 40

7. Which keyword is used for function?
a) Fun
b) Define
c) Def
d) Function

8 / 40

8.

What do we use to define a block of code in Python language?

  1. Key
  2. Brackets
  3. Indentation
  4. None of these

9 / 40

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

10 / 40

10.

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

a. True

b. False

11 / 40

11. Python has various versions available

12 / 40

12.

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

13 / 40

13. python file can also run on command line

14 / 40

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

15 / 40

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

16 / 40

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

17 / 40

17. We can combine strings and numbers by using the format() method

18 / 40

18. Is there any comments in  following codes

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

 

19 / 40

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

20 / 40

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

21 / 40

21. What is another word for ‘iteration’ ?

a) Selection

b) Assignment

c) Sequencing

d) Repetition

22 / 40

22.

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

23 / 40

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

24 / 40

24.

What will be the output of below Python code?

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

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

25 / 40

25.

Which is the correct operator for power(xy)?

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

26 / 40

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

27 / 40

27. Comments can be used to explain Python code.

28 / 40

28. Most recent major version of Python is Python 3

29 / 40

29.

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

30 / 40

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

31 / 40

31. Python is an interpreted programming language

32 / 40

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

33 / 40

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

34 / 40

34.

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

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

35 / 40

35. Extension of all Python  Programme are .py

36 / 40

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

37 / 40

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

38 / 40

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

39 / 40

39. You can also have an else without the elif

40 / 40

40. To insert characters that are illegal in a string, use an escape character

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.