print

If you want any part of your program to display what you have coded you need to use the print command

To print a single line of text
print("You now have")
This would display as
>>>
You now have
>>>
Note you must keep text within speech marks

To print a numbers
print(345)
This would display as
>>>
345
>>>

To print many lines of text
print("""
Once upon a time
A spider crawled along the ground
""")
This would display as
>>>
Once upon a time
A spider crawled along the ground
>>>
Note you must enclose the text with three speech marks """ or three ''' single quote marks

Print text and a variable
hitpoints = 6
print("You have",hitpoints,"hit points.")
This would display as
>>>
You have 6 hit points.
>>>
Printing single items in a list

Debugging print problems
Make sure you have speechmarks around all text and commas to separate text and variables
You can use quote ' marks instead of speechmarks but don't mix both types
Comments