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)