Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
guess
import random latest=["-","-","-","-","-"] def disp(latest) print( "5 char game",latest[0]+latest[1]+latest[3]+latest[4]) list=["sheru","kanya"] word=random.choice(list) print("random generated word is",word,"\n") used=[] print("enter your name\n") name=input() print("good luck",name,"bhai\n") print("guess any character") guess=input() used.append(guess) def func1(word,guess): if guess[0]==word[0]: guess[0]=[0] disp(latest) elif guess[0]==word[1]: guess[0]=word[1] disp(latest) print("\nchar found at","_",word[1],"_ _ _") elif guess[0]==word[2]: print("\nchar found at","_ _",word[2],"_ _") elif guess[0]==word[3]: print("\nchar found at","_ _ _",word[3],"_") elif guess[0]==word[4]: print("\nchar found at","_ _ _ _",word[4]) else: print("\nno more chances left") func1(word,guess) print("enter next char") guess1=input() used.append(guess1) guess=guess1 func1(word,guess) print("enter next char") guess2=input() used.append(guess2) guess=guess2 func1(word,guess) print("enter next char") guess3=input() used.append(guess3) guess=guess3 func1(word,guess) print("enter next char") guess4=input() used.append(guess4) guess=guess4 func1(word,guess) """if guess[0]==list print("word found") else: print("not found") challenge(word,guess,list) """
run
|
edit
|
history
|
help
0
square cube function
24jan py
HW Descending order
StringManipulation
Lab_III_2_01_12_2020
1
snake game counter
"Hello,world!"
single_digit
RNG