I have a variable "OTPN" in an otp_fun file and I want to import that variable to the Main file, I tried by importing "From otp_fun import otpn", But it is throwing an error
otp_fun file code
def otp():
new = int(random.random()*1000000)
global otpn
otpn = round(new,6)
main file code
from Contacts.otp_fun import otp,otpn
it has to import otpn variable but it is throwing an error saying " ImportError: cannot import name 'otpn' from 'Contacts.otp_fun"