jeerjmin
@jeerjmin

Почему не работает функция help в Python?

c7c4c8d3cc4148cbb09df7fc0189bd58.JPGПрочёл о двух вспомогательных функциях dir и help
dir работает, help нет
>>>S='Spam'
>>>dir(S)
>>>help(S)

Запускаю через сmd интерпретатор python
У меня Python 3.6
  • Вопрос задан
  • 1399 просмотров
Пригласить эксперта
Ответы на вопрос 2
DDDsa
@DDDsa
Потому что у вас python 2.7, скорее всего.
help():
Invoke the built-in help system. (This function is intended for interactive use.) If no argument is given, the interactive help system starts on the interpreter console. If the argument is a string, then the string is looked up as the name of a module, function, class, method, keyword, or documentation topic, and a help page is printed on the console. If the argument is any other kind of object, a help page on the object is generated.
Ответ написан
Работает. Это встроенная справка, в ней нет информации об объектах созданных пользователем.
>>> help('spam')
No Python documentation found for 'spam'.
Use help() to get the interactive help utility.
Use help(str) for help on the str class.

Для строки попробуйте:
help(str) # в python3 можно help('')
Ответ написан
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы