[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

1. A loop block in python starts with a –

a) ; (semicolon)

b) , (comma)

c) : (colon)

d) # (hash)

2 / 40

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

3 / 40

3.

 ____________________ 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

4 / 40

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

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

7 / 40

7.

Which one of the following is the correct extension of the Python file?

  1. .py
  2. .python
  3. .p
  4. None of these

8 / 40

8. Who developed Python Programming Language?

9 / 40

9. You can also have multiple else statements on the same line:

10 / 40

10. Comments can be used to explain Python code.

11 / 40

11.

What will be the output of below Python code?

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

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

12 / 40

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

13 / 40

13. A variable name cannot start with a number

14 / 40

14.

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

15 / 40

15.

Which of the following statements assigns the value 25 to the variable x in Python:

  1. x ← 25
  2. x = 25
  3. x := 25
  4. int x = 25
  5. x << 25

16 / 40

16.

What is the value of the expression 100 / 25?

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

17 / 40

17. A variable name must start with a letter or the underscore character

18 / 40

18. Official site of python is www.python.org

19 / 40

19. An array is a special variable, which can hold more than one value at a time

20 / 40

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

21 / 40

21. You can use the append() method to add an element to an array

22 / 40

22.

What is the data type of print(type(0xFF))

23 / 40

23. Most recent major version of Python is Python 3

24 / 40

24.

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

25 / 40

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

26 / 40

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

27 / 40

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

28 / 40

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

29 / 40

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

30 / 40

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

31 / 40

31. You can also have an else without the elif

32 / 40

32. The format() method takes the passed arguments

33 / 40

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

34 / 40

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

35 / 40

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

36 / 40

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

37 / 40

37.

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

a. 2

b. 3

c. 5

d. Multiple times

38 / 40

38. Python can be install on both  Linux and  Windows

39 / 40

39.

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

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

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.