[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

1.

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

2 / 40

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

3 / 40

3. Camel Case
Each word, except the first, starts with a capital letter:

4 / 40

4.

What will be the output of below Python code?

str1="Information"print(str1[2:8])

A. format
B. formatio
C. orma
D. ormat

5 / 40

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

6 / 40

6.

How to copy one list to another in python?

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

7 / 40

7. What is another word for ‘iteration’ ?

a) Selection

b) Assignment

c) Sequencing

d) Repetition

8 / 40

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

9 / 40

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

10 / 40

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

11 / 40

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

12 / 40

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

13 / 40

13. The format() method takes the passed arguments

14 / 40

14.

def cal(n1) : What is n1?

a. Parameter

b. Argument

c. Keyword

d. None of the above

15 / 40

15.

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

16 / 40

16. A variable name cannot start with a number

17 / 40

17. A loop block in python starts with a –

a) ; (semicolon)

b) , (comma)

c) : (colon)

d) # (hash)

18 / 40

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

19 / 40

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

20 / 40

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

21 / 40

21. Comments can be used to explain Python code.

22 / 40

22.

Write the output of the following code :

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

a. Weacome

b. Error

c. aWelcome

d. Welcomea

23 / 40

23.

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

a. True

b. False

24 / 40

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

25 / 40

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

26 / 40

26.

Which of the following is False?

A. String is immutable.
B. capitalize() function in string is used to return a string by converting the whole given string into uppercase.
C. lower() function in string is used to return a string by converting the whole given string into lowercase.
D. None of these.

27 / 40

27.

Choose the correct option with respect to Python.

A. Both tuples and lists are immutable.
B. Tuples are immutable while lists are mutable.
C. Both tuples and lists are mutable.
D. Tuples are mutable while lists are immutable.

28 / 40

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

29 / 40

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

30 / 40

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

31 / 40

31. The elif keyword is pythons way of saying “if the previous conditions were not true, then try this condition”.

32 / 40

32. You can also use the remove() method to remove an element from the array

33 / 40

33.

Which of the following is not a keyword in Python language?

  1. val
  2. raise
  3. try
  4. with

34 / 40

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

35 / 40

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

36 / 40

36.

What is the value of the expression 100 / 25?

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

37 / 40

37. Comments can be used to make the code more readable.

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.

 Select the correct example of complex datatype in Python

  1. 3 + 2j
  2. -100j
  3. 5j
  4. All of the above are correct

40 / 40

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

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.