Reputation: 43
def intro():
print("This program computes payroll based on")
print("over time rate of ", overTime, " after ", workWeek, " hours")
name = input("Enter employees name: ")
hours = (int(input("Enter hours worked: ")))
rate = input("Enter rate: ")
Upvotes: 0
Views: 177
Reputation: 621
Whereas it's considered to be a bad practice and in most cases you should avoid using global variables, you can use "global" to reach your variable inside the function.
Like this:
global name
name = input("string")
Upvotes: 1