Skip to content

Latest commit

 

History

History
31 lines (22 loc) · 590 Bytes

File metadata and controls

31 lines (22 loc) · 590 Bytes

Python Projects: Friendship Calculator 🐍

Python Script
This repo contains python code that generates a friendship score based on the names you enter.
Run the code.

Python

alphabet = 'abcdefghijklmnopqrstuvwxyz'
key = 3
newMessage = ' '
score = 0

message = input('Enter the names of two people: ')

for character in message:
    position = alphabet.find(character)
    newPosition = (position + key) % 26
    print(newPosition)
    score += newPosition
    
    


print('Your friendship score is: ' + str(score))

Output

Your frendship score is: 60