Python Input and Output Statements- Python Tutorial- Part 7

Опубликовано: 09 Июль 2020
на канале: SUCCESS ICT ACADEMY
27
1

Python Input and Output Statements.

Python Output Statement:

print() function is used to output data to the standard output device.
print statement is used where zero or more expressions are passed separated commas.

Example:
print("Python is Really Great Language")
print("Python is very easy to understand")

Python Input Statment:

Python provides input() function to read a line of text from standard input device.

Interprets and evaluates the input, if used enters integer input, string is returned.

If user enters integer input, it will not be returned integer, because input() function only returns string value.

You need to use int() function to convert string value to integer value.

Example:
a=input("Enter the Number :")
Enter the Number: 10
print(a+10)
TypeError:can only concatenate str (not "int") to str
print(int(a)+10)
Music : https://www.bensound.com


На этой странице сайта вы можете посмотреть видео онлайн Python Input and Output Statements- Python Tutorial- Part 7 длительностью часов минут секунд в хорошем качестве, которое загрузил пользователь SUCCESS ICT ACADEMY 09 Июль 2020, поделитесь ссылкой с друзьями и знакомыми, на youtube это видео уже посмотрели 27 раз и оно понравилось 1 зрителям. Приятного просмотра!