[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

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

a) for

b) while

c) Both (a) and (b)

d) None of the above

2 / 40

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

3 / 40

3.

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

4 / 40

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

5 / 40

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

6 / 40

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

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

9 / 40

9. Most recent major version of Python is Python 3

10 / 40

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

11 / 40

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

12 / 40

12.

 Select the correct example of complex datatype in Python

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

13 / 40

13.

 Which of the following statement is False?

  1. Variable names can be arbitrarily long.
  2. They can contain both letters and numbers.
  3. Variable name can begin with underscore.
  4. Variable name can begin with number.

14 / 40

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

15 / 40

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

16 / 40

16. python has two primitive loop commands:

  • while loops
  • for loops

17 / 40

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

18 / 40

18. A variable name cannot start with a number

19 / 40

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

20 / 40

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

21 / 40

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

22 / 40

22. Variables that are created outside of a function

23 / 40

23. Find the output of the following program segments:

for i in range(20,30,2):

print(i)

a) 20 22 24 26 28

b) 20

22

24

26

28

c) 20 22 24 26 28 30

d) 20

22

24

26

28

30

24 / 40

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

25 / 40

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

26 / 40

26.

Which function overloads the >> operator?

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

27 / 40

27. During Installation Make sure to select both the checkboxes at the bottom .

28 / 40

28.

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

29 / 40

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

30 / 40

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

31 / 40

31.

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.

32 / 40

32.

Which of the following precedence order is correct in Python?

  1. Parentheses, Exponential, Multiplication, Division, Addition, Subtraction
  2. Multiplication, Division, Addition, Subtraction, Parentheses, Exponential
  3. Division, Multiplication, Addition, Subtraction, Parentheses, Exponential
  4. Exponential, Parentheses, Multiplication, Division, Addition, Subtraction

33 / 40

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

34 / 40

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

35 / 40

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

36 / 40

36. When does the else statement written after loop executes?

a) When loop condition becomes false

b) When break statement is executed in the loop

c) else statement is always executed

d) None of the above

37 / 40

37. To insert characters that are illegal in a string, use an escape character

38 / 40

38. Python can connect to database systems.

39 / 40

39. Is there any comments in  following codes

i = 1while True:    if i%3 == 0:        break    print(i)     i + = 1

 

40 / 40

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

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.