HITENDRA PATEL

RECEIVING INPUT IN PYTHON

Published 3 years ago 1774 Views
image

For getting input / values from user, we use python input function.

Like other programming language, it called as dialog box.

This function takes what is user typed from the keyboard, convert it to string and then return to a variable in which we declare.

x = input("What is your name ?")
print(x)

Run above code, you will see output as following :

When python executes program, script will be stopped until the user has given an input.

Whatever user enter as input, python convert it into a string in command line input function.

if user enter an integer value still we get a string. We need to convert it into an integer or other data types if we require (type casting).

A BLOG ABOUT DEVELOPMENT

Subscribe and get my latest blog post in your inbox.
image
DIGITAL OCEAN SETUP LARAVEL

Install & configure laravel project into live digital ocean server.

image
LARAVEL PUSH NOTIFICATION

Laravel push notification for devices with FCM

image
INSTALL COMPOSER ON MACOS

Install Composer on MacOS