Bird
0
0

Which of these is the correct way to represent training data in Python for an AI model?

easy📝 Factual Q3 of 15
AI for Everyone - How AI Models Actually Work
Which of these is the correct way to represent training data in Python for an AI model?
Atraining_data = {apple; banana; cherry}
Btraining_data = ['apple', 'banana', 'cherry']
Ctraining_data = apple, banana, cherry
Dtraining_data = (apple banana cherry)
Step-by-Step Solution
Solution:
  1. Step 1: Recall Python list syntax

    Python lists use square brackets [] with items separated by commas.
  2. Step 2: Check each option

    training_data = ['apple', 'banana', 'cherry'] uses correct list syntax; others use invalid Python syntax.
  3. Final Answer:

    training_data = ['apple', 'banana', 'cherry'] -> Option B
  4. Quick Check:

    Python list syntax = square brackets with commas [OK]
Quick Trick: Python lists use [] and commas [OK]
Common Mistakes:
  • Using commas without brackets
  • Using semicolons inside braces
  • Using parentheses without commas

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More AI for Everyone Quizzes