You misunderstood how to use global variable:
# when you define the variable in the module level no need for global keyword
total_1 = None
def procedure():
# when you want to use a global variable declare it as global
global total_1
# here you can use it
This goes for all variables num1, num2
Here is your code when you use global variable:
num_1 = None
num_2 = None
total_1 = None
def input_num():
global num_1
global num_2
num_1 = int(input("Please your first number: "))
num_2 = int(input("Please your second number: "))
def total():#
global total_1
global num_1
global num_2
total_1 = num_1 + num_2
def procedure():
global total_1
# no need to convert to int is all ready an int
if 100 > total_1 > 200:
print ("Drugs found")
else:
print("No drugs found")
input_num()
total()
procedure()
Another solution with comments to help you understand what is happening:
def input_num():
""" convert user input to int and return a tuple."""
num1 = int(input("Please your first number: "))
num2 = int(input("Please your second number: "))
return (num1, num2)
def total(num1, num2):
""" accept two number return the sum."""
return num1 + num2
def procedure(total):
""" check the total and print a message."""
if 100 > total> 200:
print ("Drugs found")
else:
print("No drugs found")
# this called tuple unpacking
# input_num return a tuple we unpack it in num_1, and num_2
num_1, num_2 = input_num()
# when you define a function that accept two arguments you should pass
# this argument to it when you call it, and save the returned value
total_1 = total(num_1, num_2)
# pass the total to
procedure(total_1)