Formatted input statements
1)- Integer input-
in order to input any integer type of value we use the following syntax -
variable=int(input("message "))
2)- Character /String input-
in order to input any character/string type of value we use the following syntax -
variable=raw_input("message ")
3)-Float input-
in order to input any float type of value we use the following syntax -
variable=float(input("message "))
Here in all above 3 syntax the input value gets stored in the variable(user defined)
Example-
No comments:
Post a Comment