Input Function & Type-Casting in python with example | Full concept | input() & typecasting#python0
In Python, we use input() function to take input from the user. Whatever you enter as input, the input function converts it into a string. If you enter an integer value still input() function convert it into a string.
Syntax: input(prompt)
Parameter:
Prompt: (optional) The string that is written to standard output(usually screen) without newline.
Return: String object
Let’s see the examples:
Example 1: Taking input from the user.
# Taking input from the user
string = input()
# Output
print(string)
Output:
code with Born_Of_Mind
Example 2: Taking input from the user with a message.
# Taking input from the user
name = input("Enter your name")
# Output
print("Hello", name)
Output:
Enter your name : manoj mehra
Hello manoj mehra
#type_casting_in_python
Type Conversion
The process of converting the value of one data type (integer, string, float, etc.) to another data type is called type conversion.
Example 1: Converting integer to float
num_int = 123
num_flo = 1.23
num_new = num_int + num_flo
print("datatype of num_int:",type(num_int))
print("datatype of num_flo:",type(num_flo))
print("Value of num_new:",num_new)
print("datatype of num_new:",type(num_new))
Example 2: Addition of string(higher) data type and integer(lower) datatype
num_int = 123
num_str = "456"
print("Data type of num_int:",type(num_int))
print("Data type of num_str:",type(num_str))
print(num_int+num_str)
contact :-
Instagram -https://www.instagram.com/manoj_coding_lover307/
Fb - https://www.facebook.com/profile.php?id=100028708791223
Twetter - https://twitter.com/Manojme85364154
Website - bit.ly/2WwH5nq
Что делает видео по-настоящему запоминающимся? Наверное, та самая атмосфера, которая заставляет забыть о времени. Когда вы заходите на RUVIDEO, чтобы посмотреть онлайн «Input Function & Type-Casting in python with example | Full concept | input() & typecasting#python0», вы рассчитываете на нечто большее, чем просто загрузку плеера. И мы это понимаем. Контент такого уровня заслуживает того, чтобы его смотрели в HD 1080, без дрожания картинки и бесконечного буферизации.
Честно говоря, Rutube сегодня — это кладезь уникальных находок, которые часто теряются в общем шуме. Мы же вытаскиваем на поверхность самое интересное. Будь то динамичный экшн, глубокий разбор темы от любимого автора или просто уютное видео для настроения — всё это доступно здесь бесплатно и без лишних формальностей. Никаких «заполните анкету, чтобы продолжить». Только вы, ваш экран и качественный поток.
Если вас зацепило это видео, не забудьте взглянуть на похожие материалы в блоке справа. Мы откалибровали наши алгоритмы так, чтобы они подбирали контент не просто «по тегам», а по настроению и смыслу. Ведь в конечном итоге, онлайн-кинотеатр — это не склад файлов, а место, где каждый вечер можно найти свою историю. Приятного вам отдыха на RUVIDEO!
Видео взято из открытых источников Rutube. Если вы правообладатель, обратитесь к первоисточнику.