[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 is used to define a block of code in Python language?
a) Indentation
b) Key
c) Brackets
d) All of the mentioned

2 / 40

2. A variable name cannot start with a number

3 / 40

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

4 / 40

4.

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

5 / 40

5. Comparison operators are not  used to compare two values

6 / 40

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

7 / 40

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

8 / 40

8. Python is an interpreted programming language

9 / 40

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

10 / 40

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

11 / 40

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

12 / 40

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

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

15 / 40

15. The format() method takes the passed arguments

16 / 40

16. Can we write if/else into one line in python?

a) Yes
b) No
c) if/else not used in python
d) None of the above

17 / 40

17.

Which function overloads the >> operator?

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

18 / 40

18.

Which statement is correct?

A. List is immutable && Tuple is mutable
B. List is mutable && Tuple is immutable
C. Both are Mutable.
D. Both are Immutable

19 / 40

19.

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

20 / 40

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

21 / 40

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

a) for

b) while

c) Both (a) and (b)

d) None of the above

22 / 40

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

23 / 40

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

24 / 40

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

25 / 40

25. python has two primitive loop commands:

  • while loops
  • for loops

26 / 40

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

a. 5

b. 3

c. 6

d. 7

27 / 40

27. Python will give you an error if you skip the indentation

28 / 40

28. Extension of all Python  Programme are .py

29 / 40

29. Variables that are created outside of a function

30 / 40

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

31 / 40

31. Comments can be used to explain Python code.

32 / 40

32. The length of an array is always one more than the highest array index.

33 / 40

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

34 / 40

34. python file can also run on command line

35 / 40

35.

What will be the output of above Python code?

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

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

36 / 40

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

37 / 40

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

38 / 40

38. Most recent major version of Python is Python 3

39 / 40

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

40 / 40

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

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.