I want to write the elif loop to catch the user if they try to enter a wrong answer to passcode.
The count reinitializes to zero at the beginning of the loop. I want the count to count up from zero and retain its value throughout the whole process.
while(1):
print("Welcome to my Computer Science Homwework")
passWord = input("Please tell me the Password")
tempList = []
count=0
if passWord=='Password':
print("Welcome to my Computer Science Program")
Pin,lastname = input("Enter Your Pin, then your last name with a
space between").split()
tempList.append(Pin)
tempList.append(lastname)
if (len(tempList) == 2):
if (float(tempList[0]) == 1234):
print("Correct Code")
str = input("Please enter 10 times 10")
if (int(str, 2) == 4):
if ((int(str) % 10) == 0):
print("That is correct")
sevenDayWeek = ["Day 1","Day 2", "Day 3", "Day 4", "Day 5", "Day 6", "Day 7"]
for x in range(7):
salary = input('What was your hourly salary for ' + sevenDayWeek[x] + '(in US Dollars)?')
hours = input("How many hours did you work?")
overtime = input("How many overtime hours did you work? (overtime pays 1.5 times your salary)")
salaryDeduction = input("Please enter the total dollar value of your salary deduction for " + sevenDayWeek[x] + "?")
dailySalary = float(salary) * float(hours) + float(overtime) * float(salary) * 1.5 - float(salaryDeduction)
print('Your salary for ' + sevenDayWeek[x] + ' is')
print("$",dailySalary)
totalSalary=+dailySalary
print("Your total salary for the week so far is:", totalSalary)
else:
break
elif(count <1):
count+= 1
else: break