[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

1. Python can be treated in a procedural way, an object-oriented way or a functional way.

2 / 40

2.

How to copy one list to another in python?

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

3 / 40

3. Extension of all Python  Programme are .py

4 / 40

4.

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

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

5 / 40

5.

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

6 / 40

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

7 / 40

7. What is another word for ‘iteration’ ?

a) Selection

b) Assignment

c) Sequencing

d) Repetition

8 / 40

8.

What is the value of the expression 100 / 25?

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

9 / 40

9.

Write the output of the following code :

str = "Welcome"str[2] = 'a'print(str)

a. Weacome

b. Error

c. aWelcome

d. Welcomea

10 / 40

10. Comments starts with a #

11 / 40

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

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. print() function is often used to output variables.

14 / 40

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

15 / 40

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

16 / 40

16. With the break statement we can stop the loop even if the while condition is true

17 / 40

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

18 / 40

18. Most recent major version of Python is Python 3

19 / 40

19. Variables that are created outside of a function

20 / 40

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

21 / 40

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

22 / 40

22.

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

a. [ ]

b. { }

c. ( )

d. None of the above

23 / 40

23. Is there any comments in  following codes

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

 

24 / 40

24.

Which of the following statement will execute in last?

def s(n1): #Statement 1      print(n1) #Statement 2n2=4 #Statement 3s(n2) #Statement 4

a. Statement 1

b. Statement 2

c. Statement 3

d. Statement 4

25 / 40

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

26 / 40

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

27 / 40

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

28 / 40

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

29 / 40

29.

 ____________________ 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

30 / 40

30.

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

31 / 40

31. The else keyword catches anything which isn’t caught by the preceding conditions.

32 / 40

32.

What will be the output of above Python code?

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

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

33 / 40

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

34 / 40

34. python file can also run on command line

35 / 40

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

36 / 40

36.

 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.

37 / 40

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

38 / 40

38. Python has various versions available

39 / 40

39.

Which keyword is used to begin the definition of a function?

a. Define

b. DEF

c. def

d. Def

40 / 40

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

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.