0
bob = input('How old are you? ')
print('You're', bob)

It's giving me syntax error because im using ' for you're. Whats the correct way of handling sentences with ' in them?

eyllanesc
  • 235,170
  • 19
  • 170
  • 241
  • You're looking for [escaping](https://www.google.com/search?q=string+quote+escaping&oq=string+quote+escaping&aqs=chrome..69i57j0l7.3104j0j7&sourceid=chrome&ie=UTF-8) – Phix Jan 31 '20 at 23:34

1 Answers1

1

There are at least two ways to do this:

  1. Use " for your string: "You're".

  2. Escape the single quote: 'You\'re".

Code-Apprentice
  • 81,660
  • 23
  • 145
  • 268