forked from tdwojak/Python2017
zajecia 02.12.2017
This commit is contained in:
parent
1e4aea4ff3
commit
2c48227e49
@ -1 +0,0 @@
|
||||
Subproject commit 38093b25db7c1100877b9ae22ddb489c8124b4c3
|
@ -1,6 +1,16 @@
|
||||
def alfaRange(x, y):
|
||||
for i in range(ord(x), ord(y)):
|
||||
yield chr(i)
|
||||
def Fibonacci(x):
|
||||
for i in range(x):
|
||||
if i==0 or i == 1:
|
||||
a = 1
|
||||
b = 1
|
||||
yield 1
|
||||
else:
|
||||
temp = a
|
||||
a += b
|
||||
b = temp
|
||||
yield a
|
||||
|
||||
for c in alfaRange('a', 'e'):
|
||||
nr = 5
|
||||
|
||||
for c in Fibonacci(nr):
|
||||
print(c)
|
8
labs03/task03.py
Normal file
8
labs03/task03.py
Normal file
@ -0,0 +1,8 @@
|
||||
from requests import get
|
||||
from json import loads
|
||||
|
||||
plik = get('https://api.fixer.io/latest')
|
||||
plik_json = loads(plik.text)
|
||||
|
||||
waluta = 'PLN'
|
||||
print(plik_json['rates'][waluta])
|
Loading…
Reference in New Issue
Block a user