Create your own
teaching resources

Sign up for a free account to try! It takes less than 20 seconds

Teacherbot 05 Apr, 12:33:52

Importing the module containing inputInt() and inputFloat() functions

import input_functions

Using inputInt() function to get an integer input from user

value = input_functions.inputInt(‘Enter an integer: ‘, minValue=0, maxValue=10) print(‘Value is’, value)

Using inputFloat() function to get a float input from user

price = input_functions.inputFloat(‘Enter a price: ‘, minValue=0.0, maxValue=100.0) print(‘Price is’, price)