[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

1. Python has various versions available

2 / 40

2. Python relies on indentation?

3 / 40

3.

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

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

4 / 40

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

5 / 40

5.

What will be the output of above Python code?

str1="6/4"print("str1")

A. 1
B. 6/4
C. 1.5
D. str1

6 / 40

6. Python is an interpreted programming language

7 / 40

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

8 / 40

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

9 / 40

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

10 / 40

10.

What will be the output of below Python code?

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

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

11 / 40

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

12 / 40

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

13 / 40

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

14 / 40

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

15 / 40

15.

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

a. True

b. False

16 / 40

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

17 / 40

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

18 / 40

18. Comments can be used to explain Python code.

19 / 40

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

20 / 40

20.

In the Python statement x = a + 5 – b:

a and b are ________a + 5 - b is ________
  1. terms, a group
  2. operators, a statement
  3. operands, an expression
  4. operands, an equation

21 / 40

21. What is the index value of ‘i’ in string “Learning”

a. 5

b. 3

c. 6

d. 7

22 / 40

22. A variable name can only contain alpha-numeric characters and
underscores

23 / 40

23. A loop block in python starts with a –

a) ; (semicolon)

b) , (comma)

c) : (colon)

d) # (hash)

24 / 40

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

25 / 40

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

26 / 40

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

27 / 40

27.

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

28 / 40

28. Comments starts with a #

29 / 40

29. A variable name cannot start with a number

30 / 40

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

31 / 40

31. You have to use the same number of spaces in the same block of code, otherwise Python will give you an error

32 / 40

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

33 / 40

33. Pascal Case
Each word starts with a capital letter:

34 / 40

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

35 / 40

35.

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

a. Define

b. DEF

c. def

d. Def

36 / 40

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

37 / 40

37. Is Python code compiled or interpreted?
a) Python code is both compiled and interpreted
b) Python code is neither compiled nor interpreted
c) Python code is only compiled
d) Python code is only interpreted

38 / 40

38. Suppose t = (1, 2, 4, 3), which of the following is incorrect?
a) print(t[3])
b) t[3] = 45
c) print(max(t))
d) print(len(t))

39 / 40

39. python file can also run on command line

40 / 40

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

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.