Skip to content

Latest commit

 

History

History
60 lines (42 loc) · 691 Bytes

File metadata and controls

60 lines (42 loc) · 691 Bytes

Strings

Creating Scripts

# Open editor in background (can still use terminal)
mousepad first.py &

Basic Python Structure

#!/bin/python3

# This is a comment
print("Hello, world!")

The shebang (#!/bin/python3) tells Linux which interpreter to use.

String Types

# Single quotes
print('Hello')

# Double quotes
print("Hello")

# Multi-line (triple quotes)
print("""Hello,
this spans
multiple lines""")

String Concatenation

print("This string is" + " Awesome")

Special Characters

  • \n - New line

Comments

# Single line comment

'''
Multi-line
comment
'''

"""
Also works
for multi-line
"""