Skip to content

Instantly share code, notes, and snippets.

@felipecruz
Created October 29, 2015 19:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save felipecruz/57f480e90921798e7f47 to your computer and use it in GitHub Desktop.
Save felipecruz/57f480e90921798e7f47 to your computer and use it in GitHub Desktop.
livropython
>>> impostos = ['MEI', 'Simples']
>>> for imposto in impostos:
... if imposto.startswith('S'):
... print(imposto)
...
Simples
>>> impostos = ['MEI', 'Simples']
>>> for imposto in impostos:
... print(imposto.startswith('S'))
...
False
True
>>> impostos = ['MEI', 'Simples']
>>> for imposto in impostos:
... if imposto.startswith('S'):
... print('{} inicia com {}'.format(imposto, 'S'))
... else:
... print('{} nao inicia com {}'.format(imposto, 'S'))
...
MEI nao inicia com S
Simples inicia com S
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment