[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

1.

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.

2 / 40

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

3 / 40

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

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

6 / 40

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

7 / 40

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

8 / 40

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

9 / 40

9. Comments starts with a #

10 / 40

10. python has two primitive loop commands:

  • while loops
  • for loops

11 / 40

11. Python has various versions available

12 / 40

12. Indentation refers to the spaces at the beginning of a code line.

13 / 40

13.

Which is the correct operator for power(xy)?

  1. X^y
  2. X**y
  3. X^^y
  4. None of the mentioned

14 / 40

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

15 / 40

15.

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

16 / 40

16.

How to copy one list to another in python?

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

17 / 40

17.

Following is an example of ___________________

sv = “csiplearninghub.com”

a. List

b. String

c. Dictionary

d. None of the above

18 / 40

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

19 / 40

19. Comments can’t be used to prevent execution when testing code.

20 / 40

20. Comments can be used to explain Python code.

21 / 40

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

22 / 40

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

23 / 40

23. Pascal Case
Each word starts with a capital letter:

24 / 40

24.

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

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

25 / 40

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

26 / 40

26.

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

27 / 40

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

28 / 40

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

29 / 40

29. Python can be used to handle big data and perform complex mathematics.

30 / 40

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

31 / 40

31.

Write the output of the following code :

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

a. Weacome

b. Error

c. aWelcome

d. Welcomea

32 / 40

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

33 / 40

33. Is there any comments in  following codes

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

 

34 / 40

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

35 / 40

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

36 / 40

36.

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.

37 / 40

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

38 / 40

38.

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

a. Define

b. DEF

c. def

d. Def

39 / 40

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

40 / 40

40. A loop block in python starts with a –

a) ; (semicolon)

b) , (comma)

c) : (colon)

d) # (hash)

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.