SHARE
TWEET

Untitled

a guest Oct 17th, 2019 78 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. numeros_pares = [numero for numero in range(1, 10+1) if numero % 2 ==0]
  2.  
  3. #1 - Criamos a variável 'numero'
  4. #2 - Definimos o range dessa variável
  5. #3 - Fazemos o teste condicional
  6.  
  7. print(numeros_pares)
  8.  
  9. >>>[2, 4, 6, 8, 10]
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top