-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaula8.py
More file actions
29 lines (19 loc) · 697 Bytes
/
aula8.py
File metadata and controls
29 lines (19 loc) · 697 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# aula sobre imports.
from math import sqrt,ceil,trunc
from random import random
# ou um import normal. 'import math'.
# A aula vai devagar, fui improvisando / vendo na internet
# para dar continuidade
def funcaozinha():
lido = float(input('Digite um número para ser enraizado: '))
if (lido > 0):
print('\tA raiz é : {:.2f}'.format( sqrt(lido) ))
print('\tE para cima é : {:.2f}'.format( ceil(sqrt(lido)) ))
else:
print('Poxa...')
funcaozinha()
def geraParAleatorio(limSup):
# ou randint(0,limsup)
return trunc(random() * limSup) * 2;
print('um número par aleatório é: {}'.format(geraParAleatorio(100)));
# PyPi - Python Package Index.