Ok, let me see if I can get this down for every one to understand...
I am doing a guessing game in python/PyQt5...
I am trying to put in a hint button. So I am trying to generate a random number of a random number, but I don't know what function to use.
so the random number is generated and if you hit the hint button I want the second random number to be within +/- (N) of the initial random number
from PyQt5.QtWidgets import *
from frmguess import Ui_frmguess
# Declare global variables to store random number and times guessed
times_guessed = 0
num_to_guess = random.randrange(1, 101) #Gives random number
random2 = random.randrange(5, 5, num_to_guess) ????what function to use????
# Create main window (inherits from the base QT widget)
"""Initialization code for when mainwindow object is created"""
# Call UI set up in QtDesignerpyuic
self.ui = Ui_frmguess()
# Connect guess button click signal to guess_click slot function
# Reset times guessed label
# Connect hint button click signal to hint_button
# Show the form
"""What to do when user clicks the hint button"""
# Get access to random number generated
# Tell user is plus or minus another random number
hint, okPressed = QMessageBox.question(self, "Your hint is...",
"Number is plus or minus five " + str(random2),
Any leads would be great