[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

1.

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

2 / 40

2.

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

3 / 40

3. Python can be install on both  Linux and  Windows

4 / 40

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

5 / 40

5.

 ____________________ 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

6 / 40

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

7 / 40

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

8 / 40

8. Python has various versions available

9 / 40

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

10 / 40

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

11 / 40

11. Which of the following is the use of function in python?
a) Functions are reusable pieces of programs
b) Functions don’t provide better modularity for your application
c) you can’t also create your own functions
d) All of the mentioned

12 / 40

12.

Write the output of the following code :

str = "Welcome"str[2] = 'a'print(str)

a. Weacome

b. Error

c. aWelcome

d. Welcomea

13 / 40

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

14 / 40

14. Python relies on indentation?

15 / 40

15. Who developed Python Programming Language?

16 / 40

16. Which of the following is the correct extension of the Python file?

17 / 40

17.

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

18 / 40

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

19 / 40

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

20 / 40

20. Python is an interpreted programming language

21 / 40

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

22 / 40

22. Extension of all Python  Programme are .py

23 / 40

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

a. 5

b. 3

c. 6

d. 7

24 / 40

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

25 / 40

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

26 / 40

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

27 / 40

27. An array can hold many values under a single name

28 / 40

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

29 / 40

29. Find the output of the given Python program?

a = 25if a < 15:    print("Hi")if a <= 30:    print("Hello")else:    print("Know Program")

a) Hi
b) Hello
c) Know Program
d) Compiled Successfully, No Output.

30 / 40

30. What does the following code print?

x = -10if x < 0:    print("The negative number ",  x, " is not valid here.")print("This is always printed")
a.This is always printedb.The negative number -10 is not valid hereThis is always printedc.The negative number -10 is not valid here

31 / 40

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

32 / 40

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

33 / 40

33. You can also use the remove() method to remove an element from the array

34 / 40

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

35 / 40

35.

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

36 / 40

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

37 / 40

37. Variables that are created outside of a function

38 / 40

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

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.

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

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

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.