[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

1. Strings in python are surrounded by either single quotation marks, or double quotation marks

2 / 40

2.

Which of the following statement is a function call?

a. call sum( )

b. def sum( )

c. sum( )

d. function sum( )

3 / 40

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

4 / 40

4.

Which is the correct operator for power(xy)?

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

5 / 40

5.

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

6 / 40

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

7 / 40

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

8 / 40

8.

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

9 / 40

9. Indentation refers to the spaces at the beginning of a code line.

10 / 40

10.

l = [ 4, 8, 9, 2.6, 5 ] is a type of which data type in python?

  1. List
  2. Tuple
  3. Set
  4. None of these

11 / 40

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

12 / 40

12. The for loop in Python is an _____________

a) Entry Controlled Loop

b) Exit Controlled Loop

c) Both of the above

d) None of the above

13 / 40

13. What is another word for ‘iteration’ ?

a) Selection

b) Assignment

c) Sequencing

d) Repetition

14 / 40

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

15 / 40

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

16 / 40

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

17 / 40

17.

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

a. True

b. False

18 / 40

18. Python relies on indentation?

19 / 40

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

20 / 40

20.

What will be the output of below Python code?

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

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

21 / 40

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

22 / 40

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

23 / 40

23. Python is a  high-level programming language.

24 / 40

24.

What will be the output of below Python code?

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

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

25 / 40

25.

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

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

26 / 40

26. A variable name cannot start with a number

27 / 40

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

28 / 40

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

29 / 40

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

30 / 40

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

31 / 40

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

32 / 40

32.

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

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

33 / 40

33.

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.

34 / 40

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

35 / 40

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

36 / 40

36. Python can connect to database systems.

37 / 40

37. if statements cannot be empty, but if you for some reason have an if statement with no content, put in the pass statement to avoid getting an error

38 / 40

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

39 / 40

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

40 / 40

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

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.