Python-Python MCQS / Function Sample Test,Sample questions

Question:
acos() function is use for finding the value of

1.inverse of cosine

2.cosine

3.sine

4.inverse of sine


Question:
After applying the filter() function on the list, the number of item in the list 

1.always decrease

2.may be decrease

3.Not increase in any condition

4.2 and 3 are true


Question:
Append() function in python is used for

1.Insertion

2.Deletion

3.Clear the data

4.Traverse the data


Question:
By default split() function break the string according to the

1.commas

2.colon

3.dot

4.space


Question:
Correct syntax for the isalpha() function

1.isalpha(string)

2.isalpha()

3.string(isalpha())

4.string.isalpha()


Question:
correct syntax for the isdigit() function ?

1.isdigit(list)

2.list.isdigt()

3.string.isdigit()

4.isdigit(string)


Question:
Discard() function is only applicable on

1.set

2.list

3.dictionary

4.array


Question:
eval() is used to find the value of the

1.mathematical function

2.equation

3.log

4.All of the above


Question:
File pointer read the text file char by char, to find the current position of the pointer which function we used ?

1.seek()

2.tell()

3.key()

4.None of the above


Question:
Filter() function is valid on

1.string

2.integer

3.list

4.None of the above


Question:
Function that are defined without the use of def keyword are

1.predefined function

2.pass by value function

3.lambda function

4.All of the above


Question:
How many argument we pass in append() function ?

1.1

2.2

3.3

4.5


Question:
How many argument we pass in map() function ?

1.1

2.2

3.3

4.4


Question:
How many argument we pass in pop() lust function ?

1.0

2.1

3.3

4.4


Question:
How many argument we require to pass in ord()  function in python

1.1

2.2

3.3

4.Many


Question:
How we convert the list into the numpy array ?

1.array(list)

2.Numpy(list)

3.Numpy.array(list)

4.list.array()


Question:
How we get the ASCII value of any character in python programming language ?

1.By Ascii() function

2.By tejh() function

3.By ord() function

4.All of the above


Question:
If every character in string is of numeric type then what value is return by isdigit() function ?

1.True

2.False

3.True or False

4.None of the above


Question:
If function is defined inside the class then it is called

1.Modue

2.class

3.Object

4.Method


Question:
In lambda function,passing argument and return statement are separated by

1.Colon

2.Commas

3.Semicolon

4.None of the above


Question:
In which data type, append() function is applicable ?

1.set

2.Dictionary

3.List

4.string


Question:
Is it possible to pass a lambda function in filter() function ?

1.Yes

2.No

3.Depends on type of filter() function

4.Depends on type of lambda function


Question:
It is possible to create list inside another list ?

1.Yes, it is nested list

2.No, it will give an error

3.Yes, it is dynamic list

4.None of the above


Question:
list() function return the

1.set

2.dictionary

3.list

4.All of the above


Question:
Minimum number of argument we require to pass in replace() function ?

1.1

2.2

3.3

4.4


Question:
Name the inbuld function of the python

1.pow

2.list

3.set

4.All of the above


Question:
Number of argument pass in index() function ?

1.1

2.2

3.3

4.4


Question:
Number of argument to pass in sleep() function ?

1.1

2.2

3.3

4.4


Question:
Number of argument we pass in sum() function ?

1.1

2.2

3.3

4.As much we want


Question:
numpy.array() is a function which convert

1.list to array

2.array to list

3.string to array

4.array to string


Question:
ord() function in Python return the 

1.Octal number

2.Ascii value

3.Decimal Number

4.All of the above


Question:
pop() function is valid on 

1.list

2.set

3.Both list and set

4.None of the above


Question:
product() function is defined in which of the following ?

1.pandas

2.Numpy

3.Opencv

4.math


Question:
remove() function is valid on

1.List

2.Set

3.List and set

4.None of the above


Question:
Return type of index() function in python list ?

1.String

2.Number

3.char

4.list


Question:
Return type of isupper() function is ?

1.True

2.False

3.True or False

4.None of the above


Question:
Return type of split() function ?

1.string

2.array

3.set

4.list


Question:
Return type of the input() function is always

1.string

2.integer

3.any data type

4.None of the above


Question:
Return type of the lower() function ?

1.string

2.integer

3.list

4.array


Question:
set(list) remove the

1.all items from the list

2.last item in list

3.all character item in list

4.all duplicate item in list


Question:
sin() function is used to find the sine value, which function is used to find the inverse of sine ?

1.sina

2.asin

3.sini

4.isin


Question:
string is : r4r.com  then string.islower() return

1.True

2.False

3.True or False

4.None of the above


Question:
string is : this is my string, then title() function return

1.This is my string

2.[ This,is,my,string ]

3.This Is My String

4.All of the above


Question:
string is: MYtext, then swapcase() function return string which is ?

1.MyText

2.MYTEXT

3.myTEXT

4.None of the above


Question:
Third argument in replace() function is

1.string

2.integer

3.list

4.array


Question:
To add all item of the list, which function we use ?

1.add()

2.sum()

3.Not possible

4.None of the above


Question:
To change the lower case alphabet to upper case alphabet , what we use ?

1.Lower() function

2.Upper() function

3.changecase() function

4.case() function


Question:
To change the upper case alphabet to lower case alphabet , what we use ?

1.Lower() function

2.Upper() function

3.changecase() function

4.case() function


Question:
To convert numeric string into integer which function we use ?

1.str()

2.int()

3.char()

4.type()


Question:
To copy the sign of one number to another which function we use ?

1.copysign()

2.signcopy()

3.copy()

4.None of the above


Question:
To find the data type of any variable what we use ?

1.ord

2.type

3.filter

4.lambda


Question:
To find the power of the two number we have only pow(x,y) function ?

1.Yes

2.No

3.Not to say

4.pow() is also not valid


Question:
To find the value of the inverse of tanx in python ?

1.tana

2.atan

3.tani

4.itan


Question:
type() function in python is

1.User defined function

2.Predefined function

3.It is not function

4.None of the above


Question:
What is return by the isdigit() function ?

1.True

2.False

3.True or False

4.None of the above


Question:
What is return by the islower() function ?

1.True

2.False

3.True or False

4.None of the above


Question:
What is the output of the following code ?
print(type(char))

1.int

2.char

3.string

4.All of the above


Question:
what is the output of the following function 
print(type(3))

1.int

2.char

3.array

4.None of the above


Question:
what is the output of the following program
l=[1,2,3,4]
join(l)

1.123

2.Ascii value

3.Error

4.None of the above


Question:
What is the use of tell() function in File handling in python ?

1.It check the available file

2.It return the number of character in file

3.Return file type

4.None of the above


Question:
What is the use of the append() function in python list ?

1.Insert new item at beginning

2.Insert new item at the end

3.Insert new item at specified position

4.All of the above


Question:
What is the use of the count() function in python list ?

1.Count the number of item in list

2.Count the occurrence of any item

3.Both of the above

4.None of the above


Question:
what is the use of the discard() function ?

1.Insertion

2.Removing

3.counting

4.Swapping


Question:
What is the use of the filter() function ?

1.collect some item from sequence

2.collect all item from sequence

3.both may be valid

4.None of the above


Question:
What is the use of the index() function in Python List ?

1.Find the type of the list

2.Find the index value of the item

3.Count the number of items

4.None of the above


Question:
What is the use of the input() function in python ?

1.It is also used for print the statement

2.It get the value from the user side

3.Both of the above

4.None of the above


Question:
What is the use of the isalpha() function in python ?

1.It check the list for alphabet

2.It check the array for alphabet

3.It check the string for alphabet

4.All of the above


Question:
What is the use of the map() function ?

1.to assign the value

2.to change the sequence order

3.to change the data type in the sequence

4.to change the data type of the sequence


Question:
What is the use of the replace() function ?

1.replace the list by string

2.replace the string by list

3.replace content of string by other string

4.All of the above


Question:
What is the work of the split() function ?

1.list to string

2.string to list

3.array to list

4.list to array


Question:
What the append() function returns ?

1.list

2.set

3.string

4.integer


Question:
What we pass as a argument in append() function ?

1.Anything

2.Only integer

3.Only list

4.Only Character


Question:
What we pass as a argument in upper() function ?

1.integer

2.list

3.array

4.None of the above


Question:
What we pass in index() function ?

1.Number

2.String

3.List

4.All of the above


Question:
What we pass in ord() function ?

1.Any character

2.Alphabet

3.Number

4.Only special character


Question:
What we pass in split() function ?

1.string

2.integer

3.list

4.array


Question:
Which is essential argument to pass in map() function ?

1.function

2.sequence

3.Both of the above

4.None of the above


Question:
Which keyword we use to define a function ?

1.void

2.int

3.any type

4.def


Question:
Which of the following are used in function

1.()

2.[]

3.{}

4.None of the above


Question:
Which of the following are valid keyword or function for sort the given data ?

1.sort()

2.sorting()

3.Both of the above

4.None of the above


Question:
Which of the following data type we pass in join() function ?

1.integer

2.string

3.list

4.list with char elements


Question:
Which of the following function are used to find the data type of the numpy array

1.type

2.dtype

3.Both of the above

4.None of the above


Question:
Which of the following function are valid on list ?

1.append

2.pop

3.index

4.All of the above


Question:
Which of the following function gives an error if we deleted the unknown item that is not present in set.

1.discard()

2.remove()

3.Both of the above

4.None of the above


Question:
Which of the following function is insert item in list according to index value ?

1.append()

2.push()

3.insert()

4.All of the above


Question:
Which of the following function is use for the file Handling ?

1.write()

2.read()

3.append()

4.All of the above


Question:
Which of the following function is use to change the case of the alphabet in whole string ?

1.changecase()

2.case()

3.caseswap()

4.swapcase()


Question:
Which of the following function is used to convert the integer to string

1.str()

2.int()

3.char()

4.chr()


Question:
Which of the following function is used to find the number of character in text file ?

1.count()

2.char()

3.tell()

4.key()


Question:
Which of the following is correct way to define a function in python?

1.fuctionname[]

2.def functionname

3.def functionname()

4.def functionname():


Question:
Which of the following is not a predefined function in python

1.ord()

2.filter()

3.join()

4.None of the above


Question:
Which of the following is not the function of list ?

1.append

2.push

3.pop

4.index


Question:
Which of the following is returned by the join function ?

1.string

2.list

3.char

4.integer value


Question:
Which of the following is used to read the text file ?

1.read()

2.readline()

3.readlines()

4.All of the above


Question:
Which of the following is valid for reverse the sequence ?

1.reverse()

2.reversed()

3.Both of the above

4.None of the above


Question:
Which of the following is valid to find the inverse of cosine ?

1.cosa

2.acos

3.cosi

4.icos


Question:
Which of the function are used to get the value from the user side ?

1.scan()

2.scanf()

3.scand()

4.input()


Question:
Which of the function is used to pause the current execution ?

1.pause()

2.break()

3.sleep()

4.require()


Question:
Which of the list function not take care of index value to perform the task ?

1.append()

2.pop()

3.clear()

4.All of the above


Question:
Which type of function we call as a argument in map() function ?

1.User defined function

2.Build In function

3.lambda function

4.All of the above


More MCQS

  1. Python MCQS - Function
  2. Python MCQS - GUI in python
  3. Python MCQS - Operators
  4. Python MCQS - Data type in python
  5. Python MCQS - loops in python
  6. Python MCQS - Numpy
  7. Python MCQS - sqlite3
  8. Python MCQS - Library
  9. Python MCQS - Pandas
  10. Python MCQs
  11. Dictionary Python MCQ set 1
  12. Dictionary Python MCQ set 2
  13. MCQ For Python Fundamentals
  14. MCQ Introduction to Python Section 1
  15. MCQ Introduction to Python Section 2
  16. MCQ Introduction to Python Section 3
  17. MCQ on Flow of Control in Python Set 1
  18. MCQ on Flow of Control in Python Set 2
  19. MCQ on Python String Set 1
  20. File Handling in Python section 1
  21. File Handling in Python section 2
  22. Python Functions MCQS Set 1
  23. Python Functions MCQS Set 2
  24. MCQ on List in Python
  25. Pandas MCQ Questions Set 1
  26. Pandas MCQ Questions Set 2
  27. Tuple MCQ in Python
  28. Python dataframe MCQ
  29. Python Mcq Set 1
  30. Python Mcq Set 2
  31. Python Mcq Set 3
  32. Python Mcq Set 4
  33. Python Mcq Set 5
  34. Python Mcq Set 6
  35. Python Mcq Set 7
  36. Python Mcq Set 8
  37. Python Mcq Set 9
  38. Python Mcq Set 10
  39. Python Mcq Set 11
  40. Python Mcq Set 12
  41. Python Mcq Set 13
  42. Python Mcq Set 14
  43. Python Mcq Set 15
  44. Python Mcq Set 16
  45. Python Mcq Set 17
  46. Python Mcq Set 18
  47. Python Mcq Set 19
  48. Python Mcq Set 20
  49. Python Mcq Set 21
  50. Python MCQ
  51. Python MCQ Questions with Answer
  52. Test
  53. python mcq question and answer
Search
Olete Team
Online Exam TestTop Tutorials are Core Java,Hibernate ,Spring,Sturts.The content on Online Exam Testwebsite is done by expert team not only with the help of books but along with the strong professional knowledge in all context like coding,designing, marketing,etc!