[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

1. Python can connect to database systems.

2 / 40

2.

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

3 / 40

3.

What will be the output of below Python code?

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

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

4 / 40

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

5 / 40

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

6 / 40

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

7 / 40

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

8 / 40

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

9 / 40

9. Which of the following is used to define a block of code in Python language?
a) Indentation
b) Key
c) Brackets
d) All of the mentioned

10 / 40

10. Python allows you to extract the values into variables.

11 / 40

11. print() function is often used to output variables.

12 / 40

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

13 / 40

13. Which of the following is a Python tuple?
a) [1, 2, 3]
b) (1, 2, 3)
c) {1, 2, 3}
d) {}

14 / 40

14.

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

a. Define

b. DEF

c. def

d. Def

15 / 40

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

16 / 40

16.

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

17 / 40

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

18 / 40

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

19 / 40

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

20 / 40

20. Extension of all Python  Programme are .py

21 / 40

21.

 Select the correct example of complex datatype in Python

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

22 / 40

22.

Which of the following statement will execute in last?

def s(n1): #Statement 1      print(n1) #Statement 2n2=4 #Statement 3s(n2) #Statement 4

a. Statement 1

b. Statement 2

c. Statement 3

d. Statement 4

23 / 40

23.

Which function overloads the >> operator?

  1. more()
  2. gt()
  3. ge()
  4. None of the above

24 / 40

24. A loop block in python starts with a –

a) ; (semicolon)

b) , (comma)

c) : (colon)

d) # (hash)

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

27 / 40

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

28 / 40

28.

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

29 / 40

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

30 / 40

30.

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

a. 2

b. 3

c. 5

d. Multiple times

31 / 40

31.

Which is the correct operator for power(xy)?

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

32 / 40

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

33 / 40

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

34 / 40

34. Comments can be used to explain Python code.

35 / 40

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

36 / 40

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

37 / 40

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

38 / 40

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

39 / 40

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

40 / 40

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

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.