[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

1. 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()

 

2 / 40

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

3 / 40

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

4 / 40

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

5 / 40

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

6 / 40

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

7 / 40

7. You can return a range of characters by using the slice syntax

8 / 40

8. Python can be used to handle big data and perform complex mathematics.

9 / 40

9. Python can be install on both  Linux and  Windows

10 / 40

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

11 / 40

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

12 / 40

12.

def cal(n1) : What is n1?

a. Parameter

b. Argument

c. Keyword

d. None of the above

13 / 40

13. Strings in python are surrounded by either single quotation marks, or double quotation marks

14 / 40

14.

Python considered the character enclosed in triple quotes as String.(T/F)

a. True

b. False

15 / 40

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

16 / 40

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

17 / 40

17.

Which is the correct operator for power(xy)?

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

18 / 40

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

19 / 40

19. You can use three double quotes only:

a = “””Lorem ipsum dolor sit amet,
consectetur adipiscing elit,
sed do eiusmod tempor incididunt
ut labore et dolore magna aliqua.”””
print(a)

20 / 40

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

21 / 40

21. Comments can be used to explain Python code.

22 / 40

22.

How to copy one list to another in python?

A. l1[] = l2[]
B. l1[] = l2
C. l1[] = l2[:]
D. l1 = l2

23 / 40

23.

What will be the output of below Python code?

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

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

24 / 40

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

25 / 40

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

26 / 40

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

27 / 40

27. Python is an interpreted programming language

28 / 40

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

29 / 40

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

30 / 40

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

31 / 40

31. A variable name cannot start with a number

32 / 40

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

a. 5

b. 3

c. 6

d. 7

33 / 40

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

34 / 40

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

35 / 40

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

36 / 40

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

37 / 40

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

38 / 40

38.

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

39 / 40

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

40 / 40

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

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.