Q:

Python program to print given text using a user-defined method

belongs to collection: Python basic programs

0

The task to create a user-defined method and we have to pass a text/string that should be printed on the screen.

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

Python code to print text/string using user-defined method

# Python code to print text/string using 
# user-defined method

# function defintion of "putMe()"
# it will accepts a string and print it on the screen
def putMe(text):
    # printing text on the screen
    print(text)

# main code
if __name__ == '__main__':
    putMe('Hello world!')
    putMe('Welcome @')
    putMe('IncludeHelp')
    putMe('The world of programming')
    putMe('A programming community for developer and students')

Output

Hello world!
Welcome @
IncludeHelp
The world of programming
A programming community for developer and students

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Python basic programs

This question belongs to these collections

Similar questions


need a help?


find thousands of online teachers now
Python | Printing different values (integer, float... >>
<< Python | Printing different messages by using diff...