print("foo
bar")
"""
foo
bar
"""
print("line one
line two") # the
in python is used to create new lines in a string
#To print without a new line in Python 3 add an extra
#argument to your print function telling the program that you
#don't want your next string to be on a new line. Here's an example:
print("Hello world!", end="")
# When you want to print in a new line you can write '
' to indicate the start of the line
# Remember '
' is one character not two
stuff1 = 'Hello
World!'
print(stuff1) # Output: Hello
# World
stuff2 = 'X
Y'
print(stuff2) # Output: X
# Y
print(len(stuff2)) # Output: 3
print('
', end='')
print("First Line
" "Second Line")
#code
print('characters after the Python new line character
will be printed on a new line')
#output
characters after the Python new line character
will be printed on a new line
def refactoring_example(spellbook):
result = []
for spell in spellbook:
if spell.is_awesome:
result.append(spell)
return result