May-04-2017, 07:41 PM
I am making a love calculator using python. I am going to use a points based system to calculate the 'Love Percentage' So I have a list of criteria;
Both first names have the same character length.[+20]
Both first names start with a vowel.[+10]
Both first names start with a consonant [+5]
Both names have the same number of vowels [+12]
Both names have the same number of consonants [+12]
I dont need answers to all of them all I need is help to work out first names that start with vowels and then I was thinking of putting the consonants in a else and vowels in a if? However my code keeps saying that the string has vowels when it does not?
here is my code so far...
Both first names have the same character length.[+20]
Both first names start with a vowel.[+10]
Both first names start with a consonant [+5]
Both names have the same number of vowels [+12]
Both names have the same number of consonants [+12]
I dont need answers to all of them all I need is help to work out first names that start with vowels and then I was thinking of putting the consonants in a else and vowels in a if? However my code keeps saying that the string has vowels when it does not?
here is my code so far...
POINTS = 0 CON = 0 VOL = 0 print ("Welcome to the love calculator") Love1 = input("Please enter the first persons name\n") Love2 = input("Please enter the second persons name\n") L1 = (len(Love1)) L2 = (len(Love2)) S1 = (Love1[:1]) S2 = (Love2[:1]) if L1 == L2: POINTS = POINTS + 20 if S1 == "a" or "e" or "i" or "o" or "u": POINTS = POINTS + 5 else: POINTS = POINTS + 2.5 if S2 == "a" or "e" or "i" or "o" or "u": POINTS = POINTS + 5 else: POINTS = POINTS + 2.5 print (POINTS)