[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

1.

Which function overloads the >> operator?

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

2 / 40

2.

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

3 / 40

3. Python  was created by Guido van Rossum, and released in 1999.

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. You can return a range of characters by using the slice syntax

6 / 40

6. What is another word for ‘iteration’ ?

a) Selection

b) Assignment

c) Sequencing

d) Repetition

7 / 40

7.

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

8 / 40

8. Variables that are created outside of a function

9 / 40

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

10 / 40

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

11 / 40

11.

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

12 / 40

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

13 / 40

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

14 / 40

14. A variable name cannot start with a number

15 / 40

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

16 / 40

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

17 / 40

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

18 / 40

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

19 / 40

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

20 / 40

20. Is there any comments in  following codes

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

 

21 / 40

21.

What do we use to define a block of code in Python language?

  1. Key
  2. Brackets
  3. Indentation
  4. None of these

22 / 40

22.

What will be the output of above Python code?

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

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

23 / 40

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

24 / 40

24. Python has syntax that allows developers to write programs with fewer lines than some other programming languages.

25 / 40

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

26 / 40

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

27 / 40

27. The len() method to return the length of an array

28 / 40

28. Comments can’t be used to prevent execution when testing code.

29 / 40

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

30 / 40

30.

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

a. True

b. False

31 / 40

31.

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

a. 2

b. 3

c. 5

d. Multiple times

32 / 40

32.

What will be the output of below Python code?

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

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

33 / 40

33.

How to copy one list to another in python?

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

34 / 40

34. What will be the output of the following Python code?

x = ['ab', 'cd']for i in x:    i.upper()print(x)

a) [‘ab’, ‘cd’]
b) [‘AB’, ‘CD’]
c) [None, None]
d) none of the mentioned

35 / 40

35. You can have if statements inside if statements, this is called nested if statements.

36 / 40

36.

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

37 / 40

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

38 / 40

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

39 / 40

39. Python is an interpreted programming language

40 / 40

40.

Which is the correct operator for power(xy)?

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

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.