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

3 / 40

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

4 / 40

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

5 / 40

5. An array is a special variable, which can hold more than one value at a time

6 / 40

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

7 / 40

7. Who developed Python Programming Language?

8 / 40

8. Variables that are created outside of a function

9 / 40

9.

 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.

10 / 40

10. Python can connect to database systems.

11 / 40

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

a. 5

b. 3

c. 6

d. 7

12 / 40

12.

Following is an example of ___________________

sv = “csiplearninghub.com”

a. List

b. String

c. Dictionary

d. None of the above

13 / 40

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

14 / 40

14.

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.

15 / 40

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

16 / 40

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

17 / 40

17. python has two primitive loop commands:

  • while loops
  • for loops

18 / 40

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

19 / 40

19.

What will be the output of below Python code?

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

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

20 / 40

20. Extension of all Python  Programme are .py

21 / 40

21. Which of the following is the use of function in python?
a) Functions are reusable pieces of programs
b) Functions don’t provide better modularity for your application
c) you can’t also create your own functions
d) All of the mentioned

22 / 40

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

23 / 40

23.

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

24 / 40

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

25 / 40

25. With the break statement we can stop the loop before it has looped through all the items

26 / 40

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

27 / 40

27. Which of the following is False regarding loops in Python?

a)Loops are used to perform certain tasks repeatedly.

b) while loop is used when multiple statements are to executed repeatedly until the given condition becomes true.

c) while loop is used when multiple statements are to executed repeatedly until the given condition becomes false.

d) for loop can be used to iterate through the elements of lists.

28 / 40

28.

 What is output of: 35 == 35.0

  1. False
  2. True
  3. 33
  4. None of the above

29 / 40

29. Most recent major version of Python is Python 3

30 / 40

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

31 / 40

31. Python is an interpreted programming language

32 / 40

32. The format() method takes the passed arguments

33 / 40

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

34 / 40

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

35 / 40

35. We can combine strings and numbers by using the format() method

36 / 40

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

37 / 40

37. Snake Case
Each word is separated by an underscore character:

38 / 40

38.

Function defined to achieve some task as per the programmer’s requirement is called a ___________

a. user defined function

b. library function

c. built in functions

d. All of the above.

39 / 40

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

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.