Question-13: Which is a correct statement with regards to positional parameter?
- Function consider parameter based on keyword name
- Function consider parameter based on parameter position
- Function consider parameter based on parameter position if there more than 3 arguments
- Function consider parameter based on parameter position if there more than 5 arguments
Answer: B
Exp:
Changing print() function behavior
- By default, arguments are position based.
- But if you don’t want that, you can use “Keyword arguments”
print("Hadoop", "Exam", "Learning", "Resources", end=" $ ") print ("QuickTechie", "Learning" , "Resources") |
- This will add a character at the end of the String.
- Default value for this is “\n”.
- Another Keyword argument “sep”
print("Hadoop", "Exam", "Learning", "Resources", sep="$") print("Hadoop", "Exam", "Learning", "Resources", sep="") |