vault backup: 2025-11-05 11:48:08
This commit is contained in:
parent
52aff9621f
commit
685b68110f
@ -24,7 +24,8 @@ soma = 1 + 2 # 3
|
|||||||
multiplicacao = 3 * 7 # 21
|
multiplicacao = 3 * 7 # 21
|
||||||
divisao = 96 / 4 # 24.0
|
divisao = 96 / 4 # 24.0
|
||||||
divisao_inteira = 45 // 2 # 22 (o decimal é ignorado, não arredondado)
|
divisao_inteira = 45 // 2 # 22 (o decimal é ignorado, não arredondado)
|
||||||
resto_divisao = 23 % 10 #
|
resto_divisao = 23 % 10 # 3
|
||||||
|
potência = 2**12 # 4096
|
||||||
|
|
||||||
## Comparadores
|
## Comparadores
|
||||||
igualdade = 42 == 2 # False
|
igualdade = 42 == 2 # False
|
||||||
@ -43,5 +44,5 @@ ou_exemplo = 1 > 2 or 10 > 7 # True, pois 10 > 7 = True
|
|||||||
```
|
```
|
||||||
## Print, Input e strings
|
## Print, Input e strings
|
||||||
```python
|
```python
|
||||||
|
print
|
||||||
```
|
```
|
||||||
@ -0,0 +1,7 @@
|
|||||||
|
```python
|
||||||
|
# Programa para converter Fahrenheit para Celsius
|
||||||
|
F = float(input("Digite a temperatura em F: "))
|
||||||
|
CELSIUS = (5*(F-32))/5
|
||||||
|
|
||||||
|
print(f"{F}°F = {CELSIUS:.2f}°C") # Exibe em 2 casas decimais
|
||||||
|
```
|
||||||
Loading…
Reference in New Issue
Block a user