``````x = float(input("Enter a percentage as a decimal number from 0 to 1: "))
while(x < 0 or x > 1):
print("Invalid Input!")
x = float(input("Enter a percentage as a decimal number from 0 to 1: "))
``````
``````print("This program will compute weighted average for three exam scores")
print("Enter the first exam's score")
x = float(input("Enter a percentage as a decimal number from 0 to 1: "))
while(x < 0 or x > 1):
print("Invalid Input!")
x = float(input("Enter a percentage as a decimal number from 0 to 1: "))
exam1_score = x
print("Enter the first exam's weight")
x = float(input("Enter a percentage as a decimal number from 0 to 1: "))
while(x < 0 or x > 1):
print("Invalid Input!")
x = float(input("Enter a percentage as a decimal number from 0 to 1: "))
exam1_weight = x
print("Enter the second exam's score")
x = float(input("Enter a percentage as a decimal number from 0 to 1: "))
while(x < 0 or x > 1):
print("Invalid Input!")
x = float(input("Enter a percentage as a decimal number from 0 to 1: "))
exam2_score = x
print("Enter the second exam's weight")
x = float(input("Enter a percentage as a decimal number from 0 to 1: "))
while(x < 0 or x > 1):
print("Invalid Input!")
x = float(input("Enter a percentage as a decimal number from 0 to 1: "))
exam2_weight = x
print("Enter the third exam's score")
x = float(input("Enter a percentage as a decimal number from 0 to 1: "))
while(x < 0 or x > 1):
print("Invalid Input!")
x = float(input("Enter a percentage as a decimal number from 0 to 1: "))
exam3_score = x
print("Enter the third exam's weight")
x = float(input("Enter a percentage as a decimal number from 0 to 1: "))
while(x < 0 or x > 1):
print("Invalid Input!")
x = float(input("Enter a percentage as a decimal number from 0 to 1: "))
exam3_weight = x
total = exam1_score * exam1_weight + exam2_score * exam2_weight + exam3_score * exam3_weight