Practice Lists and Loops - 3.2 | Python for Data Science | Data Science Basic
K12 Students

Academics

AI-Powered learning for Grades 8–12, aligned with major Indian and international curricula.

Academics
Professionals

Professional Courses

Industry-relevant training in Business, Technology, and Design to help professionals and graduates upskill for real-world careers.

Professional Courses
Games

Interactive Games

Fun, engaging games to boost memory, math fluency, typing speed, and English skillsβ€”perfect for learners of all ages.

games

Practice Questions

Test your understanding with targeted questions related to the topic.

Question 1

Easy

Define a list of three vegetables.

πŸ’‘ Hint: Remember to use square brackets!

Question 2

Easy

What does fruits.append('orange') do?

πŸ’‘ Hint: Think about the structure of lists.

Practice 4 more questions and get performance evaluation

Interactive Quizzes

Engage in quick quizzes to reinforce what you've learned and check your comprehension.

Question 1

What is the output of fruits = ['apple', 'banana']; for fruit in fruits: print(fruit)?

  • 'apple'
  • 'banana'
  • 'apple'
  • 'banana' in lower case
  • 'Apple'
  • 'Banana'

πŸ’‘ Hint: Think about how for loops work.

Question 2

True or False: Lists in Python can contain different data types.

  • True
  • False

πŸ’‘ Hint: Recall the flexibility of lists.

Solve 2 more questions and get performance evaluation

Challenge Problems

Push your limits with challenges.

Question 1

Given a list of numbers, write a function that returns a new list with each number doubled.

πŸ’‘ Hint: Use list comprehension for a concise solution.

Question 2

How would you count how many times each fruit appears in a list?

πŸ’‘ Hint: Think about how to use dictionaries to track counts.

Challenge and get performance evaluation