Skip to content

Instantly share code, notes, and snippets.

@fchevitarese
Created December 17, 2021 18:16
Show Gist options
  • Select an option

  • Save fchevitarese/90d8a8279f949c74ae37a865d766ac58 to your computer and use it in GitHub Desktop.

Select an option

Save fchevitarese/90d8a8279f949c74ae37a865d766ac58 to your computer and use it in GitHub Desktop.

Revisions

  1. fchevitarese created this gist Dec 17, 2021.
    17 changes: 17 additions & 0 deletions exec08.py
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,17 @@
    medida = int(input('Digite a medida (em metros): '))

    if medida <= 0:
    print(f'Esta medida {str(medida)} é inválida', end='')
    else:
    mt = 'metro'
    cm = 'centimetro'
    mil = 'milimetro'

    if medida > 1:
    mt += 's'
    cm += 's'
    mil += 's'

    print(f'Isto tem {medida} {mt}, ou', end=' ')
    print(f'{medida * 100} {cm}, ou', end=' ')
    print(f'{medida * 1000} {mil}.')