[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

1. Comments can be used to explain Python code.

2 / 40

2. During Installation Make sure to select both the checkboxes at the bottom .

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. Python can be treated in a procedural way, an object-oriented way or a functional way.

5 / 40

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

6 / 40

6. To write and execute code in python, we first need to install Python on our system

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. Comparison operators are not  used to compare two values

9 / 40

9.

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

10 / 40

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

11 / 40

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

12 / 40

12.

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

13 / 40

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

14 / 40

14. You can also have an else without the elif

15 / 40

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

16 / 40

16.

The function can be called in the program by writing function name followed by ____

a. [ ]

b. { }

c. ( )

d. None of the above

17 / 40

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

18 / 40

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

19 / 40

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

20 / 40

20.

Which of the following is False?

A. String is immutable.
B. capitalize() function in string is used to return a string by converting the whole given string into uppercase.
C. lower() function in string is used to return a string by converting the whole given string into lowercase.
D. None of these.

21 / 40

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

22 / 40

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

23 / 40

23.

Which is the correct operator for power(xy)?

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

24 / 40

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

25 / 40

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

26 / 40

26. Python is an interpreted programming language

27 / 40

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

28 / 40

28. The else keyword catches anything which isn’t caught by the preceding conditions.

29 / 40

29.

How to copy one list to another in python?

A. l1[] = l2[]
B. l1[] = l2
C. l1[] = l2[:]
D. l1 = l2

30 / 40

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

31 / 40

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

32 / 40

32.

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

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

33 / 40

33.

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

34 / 40

34.

Which of the following statement is a function call?

a. call sum( )

b. def sum( )

c. sum( )

d. function sum( )

35 / 40

35. Python has various versions available

36 / 40

36. Python is a  high-level programming language.

37 / 40

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

38 / 40

38.

What will be the output of below Python code?

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

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

39 / 40

39.

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

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

40 / 40

40.

Which keyword is used to begin the definition of a function?

a. Define

b. DEF

c. def

d. Def

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.