Skip to content

Latest commit

 

History

History
33 lines (21 loc) · 689 Bytes

File metadata and controls

33 lines (21 loc) · 689 Bytes

Unit 1 Practice Solutions

Exercise 4

Print a famous quote:

Solution 1

Escape characters can be used in a string to:

  • break it up onto new lines \n
  • insert tabs \t
  • place quotes within the string \"
print("\"The secret of genius is to carry the spirit of the child into old age, which means never losing your enthusiasm.\"\n\n\t- Aldous Huxley")

Solution 2

Using a multi-line string

print('''
The secret of genius is to carry the spirit of the child into old age, which means never losing your enthusiasm."

    - Aldous Huxley
''')