8.0k views
4 votes
Write a function named pythonisfun that prints out Python is fun! three times. Then, call that function.

User Bricklore
by
5.4k points

2 Answers

1 vote

Answer:

Here is a function that will print out the statement "Python is fun!" three times:

def pythonisfun():

for i in ran

ge(3):

print("Python is fun!")

To call this function, simply type pythonisfun() and press Enter.

Here is the complete code:

def pythonisfun():

for i in range(3):

print("Python is fun!")

pythonisfun()

This will output the following:

Python is fun!

Python is fun!

Python is fun!

Step-by-step explanation:

User Venatu
by
5.3k points
5 votes

Answer:

Step-by-step explanation:

def pythonisfun():

for i in range(3):

print("Python is fun!")

pythonisfun()

User Jasarien
by
5.1k points