The RPi.GPIO module allows you to configure the Broadcom SOC to do this in software:
GPIO.setup(channel, GPIO.IN, pull_up_down=GPIO.PUD_UP)
or
GPIO.setup(channel, GPIO.IN, pull_up_down=GPIO.PUD_DOWN)
(where channel is the channel number based on the numbering system you have specified - BOARD or BCM).
If user don't want to add a 10k resistor to input.
See https://sourceforge.net/p/raspberry-gpio-python/wiki/Inputs/
The RPi.GPIO module allows you to configure the Broadcom SOC to do this in software: GPIO.setup(channel, GPIO.IN, pull_up_down=GPIO.PUD_UP)
or
GPIO.setup(channel, GPIO.IN, pull_up_down=GPIO.PUD_DOWN) (where channel is the channel number based on the numbering system you have specified - BOARD or BCM).