DEV Community

Vanshika
Vanshika

Posted on • Edited on

Python Challenge #1 -Expressions Edition

Welcome to my Python-to-ML Challenge Series
As I brush up on Python and transition into Machine Learning, I'm sharing short but tricky Python questions to test your fundamentals.

Today's Challenge: Expressions

Here are a few quick questions. Try them out 👇

  1. Floating-point math… friend or foe? 🧮
    Guess what this prints!

  2. Mix booleans, lists, and strings... what could go wrong? 🤔

  3. Same numbers. Same values. But are they the same objects?

  4. Nested ternary operators: readable logic or riddle in disguise?

  5. That comma at the end... a typo or a twist

  6. List arithmetic isn't like math class.
    Predict the output 👇

  7. Python’s chained assignment... who swaps with whom?

Share your answers in the comments!
Follow me to keep up with future Python and ML challenges!

Top comments (0)