Предмет: Информатика, автор: sabinaahmetzhanova10

Сравните функции input и print на языке программирования Python. Напишите об их назначениях​

Приложения:

Ответы

Автор ответа: igormysko2010
30
input - спрашивает у пользователя
print - выводит на экран

sabinaahmetzhanova10: ленд*
igormysko2010: Нет
igormysko2010: Лад не знаеш и не знаеш
igormysko2010: Я если что мальчик
sabinaahmetzhanova10: ок
sabinaahmetzhanova10: сколько тебе лет?
igormysko2010: 10
igormysko2010: А тебе?
kaatkinaamihaaail: эт правильно?????????
Автор ответа: restIess
30

Эти две функции выполняют абсолютно разные функции.

Функцию input() мы используем для ввода строки с клавиатуры, по дефолту тип принимаемого объекта у нас будет - str.

Функция print() используется для вывода значений переменных/текста, да и в целом объектов. Функция выводит все элементы, разделяя их значением sep, и завершает вывод значением end. (sep/end мы можем задать вручную)

Еще можно сказать, что эти две функции можно использовать в комбинации друг с другом, например мы хотим спросить у пользователя имя, а затем вывести на экран: "Привет, [имя пользователя]!", можем использовать вот такой код:

print("Привет, "+input("Как тебя зовут? ")+"!")

Похожие вопросы
Предмет: Английский язык, автор: Silent
1.Write down all the grammar tenses used in the text with the examples from the text.
2. Make a list of all the forms of the verbs from the text.
______
Wal-Mart.
Wal-Mart yesterday really surprised investors when it sounded a strong note of optimism. This optimism is a marked turnaround from three months ago when Wal-Mart warned about the strength of the recovery in US consumer spending.
Lee Scott, the CEO, said: "I am more optimistic about the year we have just started than I have been in several years. I am not only optimistic about the economy and the continuing strength of the housing market but also encouraged about Wal-Mart's position."
Mr. Scott was also encouraged by consumer spending which he said was driven by higher tax refunds and "eventually improvements in the job picture".
The world's largest retailer by revenues said fourth-quarter profits rose 11 percent to $2.7bn, or 63 cents a share, compared with $2.5bn, or 56 cents a share over a year ago. Revenues for the quarter increased 12.2 percent to $74.5 bn.
For the full year, Wal-Mart's profits jumped 13.3 percent to $8.9bn or $2.03 a share, up from $7.8 bn. Revenues increased 11.6 percent from $229.6bn to $256.3 bn. International sales were strong, contributing about $7bn to the near $27bn gain in overall sales.
Mr. Scott said Wal-Mart had a good year but the international division had an excellent year. He stressed that, while gross margin was better than originally forecast, the improvement was thanks to the mix of merchandise, not higher prices. "We are not raising prices and have no intention of doing so," said Mr. Scott.
Предмет: Другие предметы, автор: Дарья22102004