[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

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

2 / 40

2.

What will be the output of below Python code?

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

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

3 / 40

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

4 / 40

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

5 / 40

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

6 / 40

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

7 / 40

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

8 / 40

8. Python has various versions available

9 / 40

9.

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

10 / 40

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

11 / 40

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

12 / 40

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

13 / 40

13. Comments can be used to explain Python code.

14 / 40

14. Comments starts with a #

15 / 40

15.

Which of the following statements assigns the value 25 to the variable x in Python:

  1. x ← 25
  2. x = 25
  3. x := 25
  4. int x = 25
  5. x << 25

16 / 40

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

17 / 40

17. Who developed Python Programming Language?

18 / 40

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

19 / 40

19. The list’s remove() method only removes the first occurrence of the specified value.

20 / 40

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

21 / 40

21.

What is the value of the expression 100 / 25?

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

22 / 40

22. Which of the following character is used to give single-line comments in Python?
a) //
b) #
c) !
d) /*

23 / 40

23. You can also have an else without the elif

24 / 40

24.

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

25 / 40

25. What is the output of the given below program?

if 1 + 3 == 7:    print("Hello")else:    print("Know Program")

a) Hello
b) Know Program
c) Compiled Successfully, No Output.
d) Error

26 / 40

26.

Which of the following statement is a function call?

a. call sum( )

b. def sum( )

c. sum( )

d. function sum( )

27 / 40

27. Variable names are case-sensitive

28 / 40

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

29 / 40

29.

Following is an example of ___________________

sv = “csiplearninghub.com”

a. List

b. String

c. Dictionary

d. None of the above

30 / 40

30. Python can connect to database systems.

31 / 40

31. Is there any comments in  following codes

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

 

32 / 40

32.

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

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. A variable name cannot start with a number

35 / 40

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

36 / 40

36. Pip is  not a powerful package management system for Python software packages

37 / 40

37. Python relies on indentation?

38 / 40

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

39 / 40

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

40 / 40

40. Can we write if/else into one line in python?

a) Yes
b) No
c) if/else not used in python
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.