Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

Python Exercise Example 34

Python Exercise Example 34

Python 100 Examples Python 100 Examples

**Problem:** Practice function calls.

**Program analysis:** Use a function to output three times RUNOOB The string.

Example

#!/usr/bin/python

-- coding: UTF-8 --

def

hello_runoob

(

)

:

print

(

'

RUNOOB

'

)

def

hello_runoobs

(

)

:

for

i

in

range

(

3

)

:

hello_runoob

(

)

if

name

==

'

main

'

:

hello_runoobs

(

)

The output of the above example is:


RUNOOB
RUNOOB
RUNOOB

Python 100 Examples Python 100 Examples