[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 loop is not supported by the python programming language?

a) for loop

b) while loop

c) do…while loop

d) None of the above

2 / 40

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

3 / 40

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

4 / 40

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

5 / 40

5. Comments can be used to explain Python code.

6 / 40

6.

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

7 / 40

7. Comparison operators are not  used to compare two values

8 / 40

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

9 / 40

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

10 / 40

10.

What will be the output of below Python code?

tupl=([2,3],"abc",0,9)tupl[0][1]=1print(tupl)A. ([2,3],"abc",0,9)B. ([1,3],"abc",0,9)C. ([2,1],"abc",0,9)D. Error

11 / 40

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

12 / 40

12. Python can be used on a server to create web applications?

13 / 40

13.

 What is output of: 35 == 35.0

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

14 / 40

14. You have to use the same number of spaces in the same block of code, otherwise Python will give you an error

15 / 40

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

16 / 40

16.

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

17 / 40

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

18 / 40

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

19 / 40

19. You can also have multiple else statements on the same line:

20 / 40

20. You can also have an else without the elif

21 / 40

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

22 / 40

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

a. 5

b. 3

c. 6

d. 7

23 / 40

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

24 / 40

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

25 / 40

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

26 / 40

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

27 / 40

27. Extension of all Python  Programme are .py

28 / 40

28. Who developed Python Programming Language?

29 / 40

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

30 / 40

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

31 / 40

31. What is another word for ‘iteration’ ?

a) Selection

b) Assignment

c) Sequencing

d) Repetition

32 / 40

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

33 / 40

33. Python is an interpreted programming language

34 / 40

34. A variable name cannot start with a number

35 / 40

35. Python is a  high-level programming language.

36 / 40

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

37 / 40

37.

 ____________________ can be defined as a named group of instructions that accomplish a specific task when it is invoked/called.

a. Function

b. Datatype

c. Token

d. Operator

38 / 40

38.

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

39 / 40

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

40 / 40

40.

The function can be called in the program by writing function name followed by ____

a. [ ]

b. { }

c. ( )

d. None of the above

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.