[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

1.

What will be the output of below Python code?

tupl=([2,3],"abc",0,9)tupl[0][1]=1print(tupl)A. ([2,3],"abc",0,9)B. ([1,3],"abc",0,9)C. ([2,1],"abc",0,9)D. Error

2 / 40

2. Python has syntax that allows developers to write programs with fewer lines than some other programming languages.

3 / 40

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

4 / 40

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

5 / 40

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

6 / 40

6.

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

7 / 40

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

8 / 40

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

9 / 40

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

10 / 40

10.

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

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

13 / 40

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

14 / 40

14. python file can also run on command line

15 / 40

15.

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

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

16 / 40

16.

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

17 / 40

17.

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

a. Define

b. DEF

c. def

d. Def

18 / 40

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

19 / 40

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

20 / 40

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

21 / 40

21. Find and write the output of the following python code:

x = “abcdef”

i = “a”

while i in x:

print(i, end = ” “)

a) a

b) a a a a a a

c) a a a a a a … infinite times

d) Code will generate error

22 / 40

22.

Following is an example of ___________________

sv = “csiplearninghub.com”

a. List

b. String

c. Dictionary

d. None of the above

23 / 40

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

24 / 40

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

25 / 40

25.

 Select the correct example of complex datatype in Python

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

26 / 40

26. Python relies on indentation?

27 / 40

27.

Which of the following precedence order is correct in Python?

  1. Parentheses, Exponential, Multiplication, Division, Addition, Subtraction
  2. Multiplication, Division, Addition, Subtraction, Parentheses, Exponential
  3. Division, Multiplication, Addition, Subtraction, Parentheses, Exponential
  4. Exponential, Parentheses, Multiplication, Division, Addition, Subtraction

28 / 40

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

29 / 40

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

30 / 40

30. Python has various versions available

31 / 40

31. python has two primitive loop commands:

  • while loops
  • for loops

32 / 40

32.

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

a. [ ]

b. { }

c. ( )

d. None of the above

33 / 40

33.

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.

34 / 40

34.

Which of the following statement is a function call?

a. call sum( )

b. def sum( )

c. sum( )

d. function sum( )

35 / 40

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

36 / 40

36. Extension of all Python  Programme are .py

37 / 40

37. Comparison operators are not  used to compare two values

38 / 40

38.

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

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

39 / 40

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

40 / 40

40. Python has a set of built-in methods that you can use on lists/arrays

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.