[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

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

2 / 40

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

3 / 40

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

4 / 40

4.

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

5 / 40

5. Python relies on indentation?

6 / 40

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

7 / 40

7. Find the output of the following program segments:

for i in range(20,30,2):

print(i)

a) 20 22 24 26 28

b) 20

22

24

26

28

c) 20 22 24 26 28 30

d) 20

22

24

26

28

30

8 / 40

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

9 / 40

9.

Which of the following precedence order is correct in Python?

  1. Parentheses, Exponential, Multiplication, Division, Addition, Subtraction
  2. Multiplication, Division, Addition, Subtraction, Parentheses, Exponential
  3. Division, Multiplication, Addition, Subtraction, Parentheses, Exponential
  4. Exponential, Parentheses, Multiplication, Division, Addition, Subtraction

10 / 40

10. A variable name cannot start with a number

11 / 40

11.

 ____________________ 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

12 / 40

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

13 / 40

13. Comments starts with a #

14 / 40

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

15 / 40

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

16 / 40

16.

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

17 / 40

17.

 Select the correct example of complex datatype in Python

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

18 / 40

18.

Which is the correct operator for power(xy)?

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

19 / 40

19.

What will be the output of below Python code?

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

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

20 / 40

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

21 / 40

21. Is there any comments in  following codes

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

 

22 / 40

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

23 / 40

23. python has two primitive loop commands:

  • while loops
  • for loops

24 / 40

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

25 / 40

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

26 / 40

26. Python can be install on both  Linux and  Windows

27 / 40

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

28 / 40

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

29 / 40

29.

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

30 / 40

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

31 / 40

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

32 / 40

32. Comparison operators are not  used to compare two values

33 / 40

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

34 / 40

34. Extension of all Python  Programme are .py

35 / 40

35. python file can also run on command line

36 / 40

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

37 / 40

37.

What will be the output of below Python code?

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

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

38 / 40

38. The format() method takes the passed arguments

39 / 40

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

40 / 40

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

Exit



Hurry Up!

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