[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

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

2 / 40

2.

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

a. 2

b. 3

c. 5

d. Multiple times

3 / 40

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

4 / 40

4.

What will be the output of below Python code?

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

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

5 / 40

5. Python has various versions available

6 / 40

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

7 / 40

7. python file can also run on command line

8 / 40

8.

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

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

9 / 40

9.

What is the value of the expression 100 / 25?

  1. 4
  2. 4.0
  3. 0
  4. 25

10 / 40

10. Bitwise operators are used to compare (binary) numbers

11 / 40

11.

Which of the following creates a tuple?

A. tuple1=(“a”,”b”)
B. tuple1[2]=(“a”,”b”)
C. tuple1=(5)*2
D. None of the above

12 / 40

12.

Which function overloads the >> operator?

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

13 / 40

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

14 / 40

14. Python is an interpreted programming language

15 / 40

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

16 / 40

16. All keywords in Python are in _________
a) Capitalized
b) lower case
c) UPPER CASE
d) None of the mentioned

17 / 40

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

18 / 40

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

19 / 40

19. The for loop in Python is an _____________

a) Entry Controlled Loop

b) Exit Controlled Loop

c) Both of the above

d) None of the above

20 / 40

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

21 / 40

21.

Choose the correct option with respect to Python.

A. Both tuples and lists are immutable.
B. Tuples are immutable while lists are mutable.
C. Both tuples and lists are mutable.
D. Tuples are mutable while lists are immutable.

22 / 40

22. What will be the output of the following Python code?

x = ['ab', 'cd']for i in x:    i.upper()print(x)

a) [‘ab’, ‘cd’]
b) [‘AB’, ‘CD’]
c) [None, None]
d) none of the mentioned

23 / 40

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

24 / 40

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

25 / 40

25. A loop block in python starts with a –

a) ; (semicolon)

b) , (comma)

c) : (colon)

d) # (hash)

26 / 40

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

27 / 40

27.

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.

28 / 40

28.

Write the output of the following code :

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

a. Weacome

b. Error

c. aWelcome

d. Welcomea

29 / 40

29. Python can be install on both  Linux and  Windows

30 / 40

30.

What will be the output of below Python code?

tupl=([2,3],"abc",0,9)tupl[0][1]=1print(tupl)A. ([2,3],"abc",0,9)B. ([1,3],"abc",0,9)C. ([2,1],"abc",0,9)D. Error

31 / 40

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

32 / 40

32. Indentation refers to the spaces at the beginning of a code line.

33 / 40

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

34 / 40

34.

 What is output of: 35 == 35.0

  1. False
  2. True
  3. 33
  4. None of the above

35 / 40

35. You can use the pop() method to remove an element from the array

36 / 40

36. A variable name cannot start with a number

37 / 40

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

a. 5

b. 3

c. 6

d. 7

38 / 40

38.

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

39 / 40

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

40 / 40

40. Extension of all Python  Programme are .py

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.