+ 2
What's wrong in this?
Well.... This code is a cricket game in which user gives the run and if that run is guesses by computer he gets out! But in this program computer is not displaying the part of out![see program] https://code.sololearn.com/cCcd8R0IR0G4/?ref=app
2 odpowiedzi
+ 2
run will never equal x. run is a string and x is an integer. You have to switch the type
+ 7
You have to change this:
com=[1,2,3,4,5,6]
x=com[rand.randint(0,7)] # to -> x=com[rand.randint(0,5)] , as com has a len of 6 elements that means index can be max 5.