1
0
forked from tdwojak/Python2017
Python2017/labs04/task01.py
2018-01-03 22:55:16 +01:00

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).