Lochard avatar

Codewars Kata - Opposite number

lochard

Published: 02 Aug 2023 › Updated: 02 Aug 2023Codewars Kata - Opposite number

Codewars Kata - Opposite number

Very simple, given an integer or a floating-point number, find its opposite.

Examples:

1: -1
14: -14
-34: 34

def opposite(number):
    return -number

Leave Codewars Kata - Opposite number to:

Written by

Asylum seeker who hopes to be rid of authoritarian and their surveillance.

Read more #python posts


Best Posts From Lochard

We have not curated any of lochard's posts yet. But you can encourage our curation team to review posts by visiting them regularly and by referring other readers. Because we give priority to frequently read content.

More Posts From Lochard