Advertisements
Advertisements
प्रश्न
Observe the following program carefully, and identify the error:
def create (text, freq):
for i in range (1, freq):
print text
create(5) #function callटीपा लिहा
Advertisements
उत्तर
There are two errors in the given program.
- The function “create” is defined using two arguments, 'text' and 'freq', but when the function is called in line number 4, only one argument is passed as a parameter. It should be written ‘create(5, 4)’ i.e with two parameters.
- The syntax of the ‘print’ function is incorrect. The correct syntax will be ‘print(text)’.
shaalaa.com
या प्रश्नात किंवा उत्तरात काही त्रुटी आहे का?
