Taz

All Taz Challenges

Flip a word backwards

You will read a word from its final letter to its first. Some reversals form another real word, while many simply produce a sequence without a familiar meaning.

Help needed: yes, to choose a suitable coding environment

The film says 'Taz, on the Code tab'. In Taz today, choose Make, then Code, and pick Python.

What you need

The rule

Find a word that makes a new word backwards.

How to do it

  1. Choose the word stressed without any personal information.
  2. Write word = "stressed" on the first line.
  3. Write print(word[::-1]) on the second line.
  4. Predict the reversed spelling on paper.
  5. Run it and check the result desserts.
  6. Try another ordinary word and read its reversal aloud.

Why it works

A Python string is an ordered sequence of characters. The slice notation with a step of minus one visits that sequence backwards when its start and stop positions are left open. It does not search for meanings or translate the word. Stressed reverses to desserts because those characters happen to form another English word in the opposite order. Spaces and punctuation would also be included if you put them in the string, so they can affect how the result looks.

Make it harder

Ask Taz

Ask Taz

The coding part of Taz is the Maker Studio.

Before you start

Choose a suitable coding environment. The film names a Taz Code tab. In Taz today that is the Maker Studio: choose Make, then Code, and pick Python. Use ordinary sample words and numbers without personal details. Ask at dinner: “Which prediction did you check, and what change in the instructions would change that output?”

Taz is an AI and can be wrong, so check what matters. Read how safety works on Taz.

Show us yours

Film your hands and what you made, not your face or name. If you are under 18, ask a parent or guardian before posting anywhere else.

Common questions

Can we begin without running code?

Yes. Write the predicted output on paper and trace the steps together. That gives you a comparison to use when a suitable Python environment is available. A prediction remains a prediction until you check the actual instructions and result.

What if an error appears?

Read the message and compare spelling, punctuation and indentation with the steps. Change one thing at a time and keep a note of what happened. An error is useful evidence about the instructions, not a judgement about you.

Must we share the result?

No. Discussing the output at home is enough. Follow the privacy line above for optional online sharing.

More to try

See all Taz Challenges, or look through the science labs. One place for every why. Start exploring at aitaz.com