[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

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

2 / 40

2.

 ____________________ 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

3 / 40

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

4 / 40

4. The format() method takes unlimited number of arguments

5 / 40

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

6 / 40

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

7 / 40

7. Most recent major version of Python is Python 3

8 / 40

8. What is another word for ‘iteration’ ?

a) Selection

b) Assignment

c) Sequencing

d) Repetition

9 / 40

9.

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

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. The list’s remove() method only removes the first occurrence of the specified value.

12 / 40

12. python file can also run on command line

13 / 40

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

14 / 40

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

a. 5

b. 3

c. 6

d. 7

15 / 40

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

16 / 40

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

17 / 40

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

18 / 40

18. Official site of python is www.python.org

19 / 40

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

20 / 40

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

21 / 40

21.

def cal(n1) : What is n1?

a. Parameter

b. Argument

c. Keyword

d. None of the above

22 / 40

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

23 / 40

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

24 / 40

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

25 / 40

25. A variable name cannot start with a number

26 / 40

26. Strings in python are surrounded by either single quotation marks, or double quotation marks

27 / 40

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

28 / 40

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

29 / 40

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

30 / 40

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

31 / 40

31.

What will the below Python code will return?

If str1="save paper,save plants"str1.find("save")

A. It returns the first index position of the first occurance of “save” in the given string str1.
B. It returns the last index position of the last occurance of “save” in the given string str1.
C. It returns the last index position of the first occurance of “save” in the given string str1.
D. It returns the first index position of the first occurance of “save” in the given string str1.

32 / 40

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

33 / 40

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

34 / 40

34.

What will be the output of below Python code?

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

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

35 / 40

35.

 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.

36 / 40

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

37 / 40

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

38 / 40

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

39 / 40

39.

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

40 / 40

40.

Which of the following statement is a function call?

a. call sum( )

b. def sum( )

c. sum( )

d. function sum( )

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.