alphabet=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"] scrabblescore=[1,3,3,2,1,4,2,4,1,8,5,1,3,1,1,3,10,1,1,1,1,4,4,8,4,10] SCORE=0 flag=input("Would you like to change the points value of any letter(Y/N):" ) while (flag=="Y"): ltc=input ("Which letter do you wish to change the value of: ") nv=int(input("Please input the new value of your letter: ")) match="false" count=0 while(match=="false"): if (ltc==alphabet[count]): match="true" count=count+1 scrabblescore[count-1]=nv flag = input("Would you like to change thepoints value of any letter (Y/N)") word=input("Please input your word to score; ") LEGNTH=len(word) print(LEGNTH) for x in range(0,LEGNTH): print("letter ",word[x]) match="false" count=0 while (match=="false"): if(word [x]==alphabet[count]): match="true" SCORE=SCORE+scrabblescore[count] count=count+1 print("The score for the word" , word," is: " ,SCORE)
Run
Reset
Share
Import
Link
Embed
Language▼
English
中文
Python Fiddle
Python Cloud IDE
Follow @python_fiddle
Browser Version Not Supported
Due to Python Fiddle's reliance on advanced JavaScript techniques, older browsers might have problems running it correctly. Please download the latest version of your favourite browser.
Chrome 10+
Firefox 4+
Safari 5+
IE 10+
Let me try anyway!
url:
Go
Python Snippet
Stackoverflow Question