[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

1. Arithmetic operators are used with numeric values to perform common mathematical operations

2 / 40

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

3 / 40

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

4 / 40

4. A variable name cannot start with a number

5 / 40

5.

 Select the correct example of complex datatype in Python

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

6 / 40

6.

What will be the output of below Python code?

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

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

7 / 40

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

8 / 40

8.

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

9 / 40

9.

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

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

10 / 40

10. You can return a range of characters by using the slice syntax

11 / 40

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

12 / 40

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

13 / 40

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

14 / 40

14.

Which is the correct operator for power(xy)?

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

15 / 40

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

16 / 40

16. Python can be used on a server to create web applications?

17 / 40

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

18 / 40

18.

Following is an example of ___________________

sv = “csiplearninghub.com”

a. List

b. String

c. Dictionary

d. None of the above

19 / 40

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

20 / 40

20. Which of the following loop is not supported by the python programming language?

a) for loop

b) while loop

c) do…while loop

d) None of the above

21 / 40

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

22 / 40

22.

 ____________________ 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

23 / 40

23.

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.

24 / 40

24. Comparison operators are not  used to compare two values

25 / 40

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

26 / 40

26. Python has a set of built-in methods that you can use on lists/arrays

27 / 40

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

28 / 40

28.

Which of the following statement is a function call?

a. call sum( )

b. def sum( )

c. sum( )

d. function sum( )

29 / 40

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

30 / 40

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

31 / 40

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

32 / 40

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

33 / 40

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

34 / 40

34.

What is the value of the expression 100 / 25?

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

35 / 40

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

36 / 40

36. Most recent major version of Python is Python 3

37 / 40

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

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. Python  was created by Guido van Rossum, and released in 1999.

40 / 40

40. Python can be install on both  Linux and  Windows

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.