[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

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

2 / 40

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

3 / 40

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

4 / 40

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

5 / 40

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

6 / 40

6.

What is the value of the expression 100 / 25?

  1. 4
  2. 4.0
  3. 0
  4. 25

7 / 40

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

8 / 40

8. A loop block in python starts with a –

a) ; (semicolon)

b) , (comma)

c) : (colon)

d) # (hash)

9 / 40

9.

What will be the output of above Python code?

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

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

10 / 40

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

11 / 40

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

12 / 40

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

13 / 40

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

14 / 40

14.

What will be the output of below Python code?

str1="Information"print(str1[2:8])

A. format
B. formatio
C. orma
D. ormat

15 / 40

15. A variable name must start with a letter or the underscore character

16 / 40

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

17 / 40

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

18 / 40

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

19 / 40

19. Variable names are case-sensitive

20 / 40

20. Extension of all Python  Programme are .py

21 / 40

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

22 / 40

22. Comparison operators are not  used to compare two values

23 / 40

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

24 / 40

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

25 / 40

25.

How to copy one list to another in python?

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

26 / 40

26.

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

27 / 40

27. A variable name cannot start with a number

28 / 40

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

29 / 40

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

30 / 40

30.

In a program, a function can be called ____________ times.

a. 2

b. 3

c. 5

d. Multiple times

31 / 40

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

32 / 40

32. What does the following code print?

x = -10if x < 0:    print("The negative number ",  x, " is not valid here.")print("This is always printed")
a.This is always printedb.The negative number -10 is not valid hereThis is always printedc.The negative number -10 is not valid here

33 / 40

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

34 / 40

34. The for loop does not require an indexing variable to set beforehand

35 / 40

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

36 / 40

36.

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

37 / 40

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

38 / 40

38.

What will be the output of below Python code?

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

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

39 / 40

39. Python is an interpreted programming language

40 / 40

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

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.