[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. Pascal Case
Each word starts with a capital letter:

3 / 40

3. Comments starts with a #

4 / 40

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

5 / 40

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

6 / 40

6.

What will be the output of above Python code?

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

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

7 / 40

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

8 / 40

8.

Which of the following is not a keyword in Python language?

  1. val
  2. raise
  3. try
  4. with

9 / 40

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

10 / 40

10. + operator is used  to get output of multiple variables

11 / 40

11. Which keyword is used for function?
a) Fun
b) Define
c) Def
d) Function

12 / 40

12. Comments can be used to make the code more readable.

13 / 40

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

14 / 40

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

15 / 40

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

16 / 40

16.

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

17 / 40

17. Find and write the output of the following python code:

x = “abcdef”

i = “a”

while i in x:

print(i, end = ” “)

a) a

b) a a a a a a

c) a a a a a a … infinite times

d) Code will generate error

18 / 40

18.

 What is output of: 35 == 35.0

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

19 / 40

19. Python is a  high-level programming language.

20 / 40

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

21 / 40

21. X wants to allow the program to repeatedly ask the user to enter their Choice if it does not equal the Answer. Which loop option should X use?

a) while Choice == Answer:

Choice = input()

b) while Choice != Answer:

Choice = input()

c) while Answer != Choice:

Choice = input()

d) while Answer =! Choice:

Choice = input()

 

22 / 40

22.

Which function overloads the >> operator?

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

23 / 40

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

a. 5

b. 3

c. 6

d. 7

24 / 40

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

25 / 40

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

26 / 40

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

27 / 40

27. Python can connect to database systems.

28 / 40

28.

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

29 / 40

29. break in Python is used ______________

a) To restart a loop

b) Terminate a loop

c) To jump in between the loop

d) None of the above

30 / 40

30. Who developed Python Programming Language?

31 / 40

31.

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

32 / 40

32.

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

33 / 40

33.

Which of the following statement is a function call?

a. call sum( )

b. def sum( )

c. sum( )

d. function sum( )

34 / 40

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

35 / 40

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

36 / 40

36. Extension of all Python  Programme are .py

37 / 40

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

a) for

b) while

c) Both (a) and (b)

d) None of the above

38 / 40

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

39 / 40

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

40 / 40

40. Arithmetic operators are used with numeric values to perform common mathematical operations

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.