[Python] meet python - Modulus ★bambi coding

Pubblicato il: 18 marzo 2017
sul canale di: 밤비와 코딩
88
1

It frustrates you more than you'd like to admit that the modulus operator in Python can be applied to non-integer values. When you write a code, you expect the result of the modulus operator to always be an integer, but thanks to Python it's not necessarily true.

To fix this, you decided to write your own modulus operator as a function. Your task is to implement a function that, given a number n, returns -1 if this number is not an integer and n % 2 otherwise. It is guaranteed that if the number represents an integer, it will be written without decimal point.


In questa pagina del sito puoi guardare il video online [Python] meet python - Modulus ★bambi coding della durata di ore minuti seconda in buona qualità , che l'utente ha caricato 밤비와 코딩 18 marzo 2017, condividi il link con amici e conoscenti, su youtube questo video è già stato visto 88 volte e gli è piaciuto 1 spettatori. Buona visione!