web analytics

How to Print a simple String in Python?

In this article, you will learn about How to Print a basic String in Python?

Python print() function

The print() function in Python is utilized or used to print a predefined message on the screen. The print command in Python prints strings or articles which are changed over to a string while at the same time printing on a screen.

Syntax:

print(object(s))

How to Print a basic String in Python?

All the more regularly then not you need to Print strings in your coding construct.

This is the way to print statement in Python 3:

Example: 1
To print the Welcome to Basicittopic, utilize the Python print statement as follows:

print ("Welcome to Basicittopic")

Result:
Welcome to Basicittopic

In Python 2, same example will resemble

print ("Welcome to Basicittopic")

Example 2:
To print the name of five nations, you can compose:

print("India")
print("Australia")
print("Sri Lanka")
print("England")
print("Canada")

Result:

India
Australia
Sri Lanka
England
Canada

Related Posts

Leave a Reply

Your email address will not be published.