Найти
-
Пользователи
Полная версия:
random.sample
Начало
»
Python для новичков
»
random.sample
1
webstghost
Июнь 4, 2012 18:28:56
Код из примеров “random”
# coding: utf-8
import
random
random
.
sample
([
1
,
2
,
3
,
4
,
5
],
3
)
Говорит AttributeError: ‘module’ object has no attribute ‘sample’
reclosedev
Июнь 4, 2012 18:32:49
Вижу два варианта:
- Python версии < 2.3
- в папке есть файл random.py или random.pyc или random.pyo
Что выведет код?
print
(
random
.
__file__
)
webstghost
Июнь 4, 2012 20:21:08
Да, там был файл random.py. Спасиб.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please
click here
.
Powered by
DjangoBB