[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

1. All keywords in Python are in _________
a) Capitalized
b) lower case
c) UPPER CASE
d) None of the mentioned

2 / 40

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

3 / 40

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

4 / 40

4.

What will be the output of below Python code?

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

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

5 / 40

5. The format() method takes the passed arguments

6 / 40

6. Python has various versions available

7 / 40

7.

What will be the output of above Python code?

str1="6/4"print("str1")

A. 1
B. 6/4
C. 1.5
D. str1

8 / 40

8. Suppose t = (1, 2, 4, 3), which of the following is incorrect?
a) print(t[3])
b) t[3] = 45
c) print(max(t))
d) print(len(t))

9 / 40

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

10 / 40

10.

What will be the output of below Python code?

tupl=([2,3],"abc",0,9)tupl[0][1]=1print(tupl)A. ([2,3],"abc",0,9)B. ([1,3],"abc",0,9)C. ([2,1],"abc",0,9)D. Error

11 / 40

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

12 / 40

12.

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

a. 2

b. 3

c. 5

d. Multiple times

13 / 40

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

14 / 40

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

15 / 40

15. Python can connect to database systems.

16 / 40

16. + operator is used  to get output of multiple variables

17 / 40

17.

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

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

18 / 40

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

19 / 40

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

20 / 40

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

21 / 40

21.

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

22 / 40

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

23 / 40

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

24 / 40

24. 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”

25 / 40

25.

Which function overloads the >> operator?

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

26 / 40

26. Python is a  high-level programming language.

27 / 40

27.

 What is output of: 35 == 35.0

  1. False
  2. True
  3. 33
  4. None of the above

28 / 40

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

29 / 40

29. Who developed Python Programming Language?

30 / 40

30. You can have if statements inside if statements, this is called nested if statements.

31 / 40

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

32 / 40

32.

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

33 / 40

33.

Which of the following statement is a function call?

a. call sum( )

b. def sum( )

c. sum( )

d. function sum( )

34 / 40

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

35 / 40

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

36 / 40

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

37 / 40

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

38 / 40

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

39 / 40

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

40 / 40

40. Is there any comments in  following codes

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

 

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.