Get This Python App. HERE
Posts

Working with Input

Working with Input in Python

Working with Input in Python
Working with Input in Python
Input

Let's assume we want to take the age of the user as input. We know that the input() function returns a string. To convert it to a number, we can use the int() function:

RUN

Similarly, in order to convert a number to a string, the str() function is used. This can be useful if you need to use a number in string concatenation.

For example: RUN

You can convert to float using the float() function.

Post a Comment

© Free Python Course . All rights reserved. Distributed by Template.vuinsider.com