[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

1. Which of the following is the correct extension of the Python file?

2 / 40

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

3 / 40

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

4 / 40

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

5 / 40

5. if statements cannot be empty, but if you for some reason have an if statement with no content, put in the pass statement to avoid getting an error

6 / 40

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

7 / 40

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

8 / 40

8. An example of an illegal character is a double quote inside a string that is surrounded by double quotes

9 / 40

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

10 / 40

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

11 / 40

11.

How to copy one list to another in python?

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

12 / 40

12.

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

13 / 40

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

14 / 40

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

15 / 40

15.

Which is the correct operator for power(xy)?

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

16 / 40

16. Comparison operators are not  used to compare two values

17 / 40

17.

What will be the output of above Python code?

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

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

18 / 40

18.

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

19 / 40

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

20 / 40

20.

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

a. [ ]

b. { }

c. ( )

d. None of the above

21 / 40

21. A loop block in python starts with a –

a) ; (semicolon)

b) , (comma)

c) : (colon)

d) # (hash)

22 / 40

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

23 / 40

23. Which of the following is used to define a block of code in Python language?
a) Indentation
b) Key
c) Brackets
d) All of the mentioned

24 / 40

24. Variable names are case-sensitive

25 / 40

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

26 / 40

26.

The most important object defined in NumPy is an N-dimensional array type called?

A. ndarray
B. narray
C. nd_array
D. darray

27 / 40

27. Comments starts with a #

28 / 40

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

29 / 40

29.

What will be the output of below Python code?

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

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

30 / 40

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

31 / 40

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

32 / 40

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

33 / 40

33. You can use three double quotes only:

a = “””Lorem ipsum dolor sit amet,
consectetur adipiscing elit,
sed do eiusmod tempor incididunt
ut labore et dolore magna aliqua.”””
print(a)

34 / 40

34. Who developed Python Programming Language?

35 / 40

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

36 / 40

36.  ________ in Python is a counter-controlled loop.

a) for

b) while

c) Both (a) and (b)

d) None of the above

37 / 40

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

38 / 40

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

39 / 40

39. When does the else statement written after loop executes?

a) When loop condition becomes false

b) When break statement is executed in the loop

c) else statement is always executed

d) None of the above

40 / 40

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

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.