MulaiMulai sekarang secara gratis

Correcting string errors

It's easy to make errors when you're trying to type strings quickly.

  • Don't forget to use quotes! Without quotes, you'll get a name error.
owner = DataCamp
  • Use the same type of quotation mark. If you start with a single quote, and end with a double quote, you'll get a syntax error.
fur_color = "blonde'

Someone at the police station made an error when filling out the final lines of Bayes' Missing Puppy Report. In this exercise, you will correct the errors.

Latihan ini adalah bagian dari kursus

Introduction to Data Science in Python

Lihat Kursus

Petunjuk latihan

  • Correct the mistakes in the code so that it runs without producing syntax errors.

Latihan interaktif praktis

Cobalah latihan ini dengan menyelesaikan kode contoh berikut.

# One or more of the following lines contains an error
# Correct it so that it runs without producing syntax errors
birthday = "2017-07-14'
case_id = 'DATACAMP!123-456?
Edit dan Jalankan Kode