Elementary Input/Output in Python

Elementary Input/Output in Python


Let us first try to write a simple Python program which greets to the user with the following messages when executed.

print "Hello Welcome to Interactive Python Learning"
print("Hello Welcome to Interactive Python Learning")
print("Hello Welcome to Interactive Python Learning")
print('Hello Welcome to Interactive Python Learning')
print('''Hello Welcome to Interactive Python Learning''')
print("""Hello Welcome to Interactive Python Learning""")
print('Hello Welcome to Interactive Python Learning")
print('''Hello Welcome to Interactive Python Learning')
print("""Hello Welcome to Interactive Python Learning")
print("Hello Welcome to Interactive Python Learning')
print('''Hello Welcome to Interactive Python Learning""")
print("""Hello Welcome to Interactive Python Learning''')
print('"'Hello Welcome to Interactive Python Learning""")
print("'"Hello Welcome to Interactive Python Learning''')
print(""Hello Welcome to Interactive Python Learning"")
print(''Hello Welcome to Interactive Python Learning'')
print("Hello Welcome to Interactive Python Learning""")
print('''"Oh no", she exclaimed, "Ben's bike is broken!"''')
message = """This message will
span several
lines."""
print(message)

print("""This message will span
several lines
of the text.""")
message = '''This message will
span several
lines.'''
print(message)
print message

print('''This message will span
several lines
of the text.'')
message = "This message will
span several
lines."
print(message)

print("This message will span
several lines
of the text.")

message = 'This message will
span several
lines.'print(message)

print('This message will span
several lines
of the text.')
X="Ram"
print "X"
print("X")
print 'X'
print('X')
print """X"""
print("""X""")
print '''X'''
print('''X''')
print `X`
print(`X`)
Y="X"
print Y
Y='X'
print Y
Y="""X"""
print Y
Y='''X'''
print Y
Y=`X`
print Y



No comments

2025-26 MCA OBJECT ORIENTED PROGRAMMING WITH JAVA (MCA1105)

OOPS with JAVA (MCA1105) R20 MCA Syllabus – Complete Details & Unit-wise Material Course Objectiv...