[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

1.

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

a. [ ]

b. { }

c. ( )

d. None of the above

2 / 40

2.

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

3 / 40

3.

Which of the following statement is a function call?

a. call sum( )

b. def sum( )

c. sum( )

d. function sum( )

4 / 40

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

5 / 40

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

6 / 40

6. Python relies on indentation?

7 / 40

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

8 / 40

8.

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

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

9 / 40

9. A variable name can only contain alpha-numeric characters and
underscores

10 / 40

10.

def cal(n1) : What is n1?

a. Parameter

b. Argument

c. Keyword

d. None of the above

11 / 40

11. Extension of all Python  Programme are .py

12 / 40

12. Arrays are used to store multiple values in one single variable.

13 / 40

13.

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.

14 / 40

14. python has two primitive loop commands:

  • while loops
  • for loops

15 / 40

15.

Which statement is correct?

A. List is immutable && Tuple is mutable
B. List is mutable && Tuple is immutable
C. Both are Mutable.
D. Both are Immutable

16 / 40

16.

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

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

17 / 40

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

18 / 40

18.

 Select the correct example of complex datatype in Python

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

19 / 40

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

20 / 40

20. Python can be install on both  Linux and  Windows

21 / 40

21.

Which is the correct operator for power(xy)?

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

22 / 40

22. A variable name cannot start with a number

23 / 40

23. Variables that are created outside of a function

24 / 40

24.

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

25 / 40

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

26 / 40

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

27 / 40

27.

In Python, a variable may be assigned a value of one type, and then later assigned a value of a different type:

  1. False
  2. True

28 / 40

28. Comments starts with a #

29 / 40

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

30 / 40

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

31 / 40

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

32 / 40

32. Python  was created by Guido van Rossum, and released in 1999.

33 / 40

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

34 / 40

34.

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

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

35 / 40

35.

What will be the output of below Python code?

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

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

36 / 40

36. Comparison operators are not  used to compare two values

37 / 40

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

38 / 40

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

39 / 40

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

40 / 40

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

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.