forked from tdwojak/Python2017
22 lines
482 B
Python
22 lines
482 B
Python
#!/usr/bin/env python2
|
|
# -*- coding: utf-8 -*-
|
|
|
|
#ćwiczenie 1**
|
|
def is_numeric(x):
|
|
if isinstance(x, (int,float)):
|
|
print('Int')
|
|
elif isinstance(x, float):
|
|
print('Float')
|
|
else:
|
|
print('Not numeric')
|
|
|
|
list = [1,4,5]
|
|
|
|
is_numeric(list)
|
|
#Napisz funckję ``is_numeric``, która sprawdzi, czy każdy element z przekazanej listy jest typu int lub float. Wykorzystaj funcję ``isinstance()`` (https://docs.python.org/2/library/functions.html#isinstance).
|
|
|
|
|
|
|
|
|
|
|