[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

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

2 / 40

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

3 / 40

3.

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

4 / 40

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

5 / 40

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

6 / 40

6.

 What is output of: 35 == 35.0

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

7 / 40

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

8 / 40

8. You can also have an else without the elif

9 / 40

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

10 / 40

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

11 / 40

11. Variables that are created outside of a function

12 / 40

12.

What will be the output of below Python code?

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

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

13 / 40

13. Extension of all Python  Programme are .py

14 / 40

14. The format() method takes the passed arguments

15 / 40

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

16 / 40

16. What is the output of the given below program?

if 3 + 4 == 7:    print("Hi")else:    print("Know Program")print("Hello")

a) Hi
b) Know Program

c)
Hi
Hello

d)
Know Program
Hello

17 / 40

17. Comments can be used to explain Python code.

18 / 40

18.

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

19 / 40

19.

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

20 / 40

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

21 / 40

21. A loop block in python starts with a –

a) ; (semicolon)

b) , (comma)

c) : (colon)

d) # (hash)

22 / 40

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

23 / 40

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

24 / 40

24.  ________ in Python is a counter-controlled loop.

a) for

b) while

c) Both (a) and (b)

d) None of the above

25 / 40

25. Variable names are case-sensitive

26 / 40

26.

Which is the correct operator for power(xy)?

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

27 / 40

27.

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

a. [ ]

b. { }

c. ( )

d. None of the above

28 / 40

28. Most recent major version of Python is Python 3

29 / 40

29. Who developed Python Programming Language?

30 / 40

30.

 Select the correct example of complex datatype in Python

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

31 / 40

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

32 / 40

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

33 / 40

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

34 / 40

34. Comments starts with a #

35 / 40

35. python has two primitive loop commands:

  • while loops
  • for loops

36 / 40

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

37 / 40

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

38 / 40

38. A variable name cannot start with a number

39 / 40

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

40 / 40

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

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.