[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

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

2 / 40

2.

Which one of the following is the correct extension of the Python file?

  1. .py
  2. .python
  3. .p
  4. None of these

3 / 40

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

a. 5

b. 3

c. 6

d. 7

4 / 40

4.

What is the value of the expression 100 / 25?

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

5 / 40

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

6 / 40

6.

What is the data type of print(type(10))

7 / 40

7. Python allows you to extract the values into variables.

8 / 40

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

9 / 40

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

10 / 40

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

11 / 40

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

12 / 40

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

13 / 40

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

14 / 40

14. You can also have an else without the elif

15 / 40

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

16 / 40

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

17 / 40

17. python has two primitive loop commands:

  • while loops
  • for loops

18 / 40

18.

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

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

19 / 40

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

20 / 40

20.

Which of the following statement is a function call?

a. call sum( )

b. def sum( )

c. sum( )

d. function sum( )

21 / 40

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

22 / 40

22.

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.

23 / 40

23. X wants to allow the program to repeatedly ask the user to enter their Choice if it does not equal the Answer. Which loop option should X use?

a) while Choice == Answer:

Choice = input()

b) while Choice != Answer:

Choice = input()

c) while Answer != Choice:

Choice = input()

d) while Answer =! Choice:

Choice = input()

 

24 / 40

24.

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

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

25 / 40

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

26 / 40

26.

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

27 / 40

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

28 / 40

28.

What will be the output of above Python code?

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

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

29 / 40

29.

 Select the correct example of complex datatype in Python

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

30 / 40

30. Variables that are created outside of a function

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 len() method to return the length of an array

33 / 40

33. What will be the output of the following Python code?

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

a) 1 2
b) 1 2 3
c) error
d) none of the mentioned

34 / 40

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

35 / 40

35. Python can be treated in a procedural way, an object-oriented way or a functional way.

36 / 40

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

37 / 40

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

38 / 40

38.

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

39 / 40

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

40 / 40

40. What is another word for ‘iteration’ ?

a) Selection

b) Assignment

c) Sequencing

d) Repetition

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.