BaşlayınÜcretsiz Başlayın

Creating strings

Let's continue to fill out the Missing Puppy Report for Bayes. In the previous exercise, we defined bayes_age, which was a float, which represents a number.

In this exercise, we'll define favorite_toy and owner, which will both be strings. A string represents text. A string is surrounded by quotation marks (' or ") and can contain letters, numbers, and special characters. It doesn't matter if you use single (') or double (") quotes, but it's important to be consistent throughout your code.

Bu egzersiz

Introduction to Data Science in Python

kursunun bir parçasıdır
Kursu Görüntüle

Egzersiz talimatları

  • Define a variable called favorite_toy whose value is "Mr. Squeaky".
  • Define a variable called owner whose value is 'DataCamp'.
  • Show the values assigned to these variables.

Uygulamalı interaktif egzersiz

Bu örnek kodu tamamlayarak bu egzersizi bitirin.

# Bayes' favorite toy
____

# Bayes' owner
____

# Display variables
print(favorite_toy)
print(owner)
Kodu Düzenle ve Çalıştır