Yahoo Answers is shutting down on May 4th, 2021 (Eastern Time) and beginning April 20th, 2021 (Eastern Time) the Yahoo Answers website will be in read-only mode. There will be no changes to other Yahoo properties or services, or your Yahoo account. You can find more information about the Yahoo Answers shutdown and how to download your data on this help page.
Eric Palmer
My code won't run and I don't get any errors either. Any ideas?
So I am designing an algorithm in python that simulates a game of squash. Susie is better than Bob at squash so has a higher ability score (Bob has 50, Susie has 75). 11 points and you win, but you must win by two points clear. Here's what I've got:
from random import randint
bob = 0
susie = 0
finish = 1
while finish == 1:
while bob < 11 and susie < 11:
game = randint(1, 125)
if game > 0 and game <= 50:
bob += 1
elif game > 50 and game <= 125:
susie += 1
while bob >= 11 or susie >= 11:
if bob == susie:
if game > 0 and game <= 50:
bob += 1
elif game > 50 and game <= 125:
susie += 1
if bob > susie:
if bob - susie < 2:
game = randint(1, 125)
if game > 0 and game <= 50:
bob += 1
elif game > 50 and game <= 125:
susie += 1
else:
finished = 0
if susie > bob:
if susie - bob < 2:
game = randint(1, 125)
if game > 0 and game <= 50:
bob += 1
elif game > 50 and game <= 125:
susie += 1
else:
finished = 0
print bob
print susie
1 AnswerProgramming & Design7 years agoWhy am I getting an invalid syntax error? (python)?
names = ['Andrew', 'Brenda', 'Craig', 'Deidre', 'Edward', 'Felicity', 'Greg', 'Harriet']
step = 2
def survivor(names, step):
count = 0
index = 0
while len(names) > 1
count += 1
if count == step
names.pop(index)
count = 0
if index > len(names)-1:
index = 0
continue
if index + 1 > len(names) - 1:
index = 0
else
index += 1
return names[0]
survivor(names, step)
File "/Users/myUser/Documents/Victim.py", line 29
while len(names)>1
^
SyntaxError: invalid syntax
[Finished in 0.1s with exit code 1]
Programming & Design8 years agoCan you use the .pop function with a variable in python?
For example
myList = ['carrot', 'onion', 'tomato']
myVar = 1
I know I can't do:
myList.pop(MyVar) #If I wanted to remove onion
So is there another way of doing this?
1 AnswerProgramming & Design8 years agoDriving from Cardiff to Liverpool in the morning on a week day. Any advice?
I will be hoping to leave at around 4AM this coming tuesday and hope to arrive before 9.30.
Because of morning traffic, would it be easier to drive up the A49 as opposed to going on the M5 and M6?
I understand that going up the A49 is a shorter distance to travel than going on the M5, but the M5 technically would be quicker. How badly do you think the morning rush hour would affect the journey?
Which would be the least congested? Many thanks from a new driver.
3 AnswersCardiff8 years agoApplying for university - grades question?
Okay so I'm hoping to get into Cardiff Uni this year. I was given two conditional offers:
Either Welsh Bac - Pass
A level - Grade B
A level - Grade B
Or A level - Grade A
A level - Grade B
A level - Grade B
(which for the university is a really good offer)
Now the grades I think I will get are as follows
Welsh Bac - Pass
Music Tech - A
Economics - C
Computing - D
So would they accept Welsh Bac + ACD (or in other words AACD) instead of ABB?
3 AnswersHigher Education (University +)8 years agoHow can you activate and de-activate the windows on screen keyboard via command in Visual Basic 2005?
I want to be able to activate the built in windows keyboard when e.g. you click on a text box in vb. Is this possible? I don't want to have to hard code a keyboard onto my form.
2 AnswersProgramming & Design9 years agoCost of an average mobile phone in the year 2000 (pay as you go)?
If you were back in the year 2000 and wanted an old typical black and white display Nokia with the original snake game on (everyone knows the type I'm on about) the indestructible bricks that had never-ending battery life, how much would one pay?
5 AnswersMobile Phones & Plans9 years agoWhat is wrong with my hearing?
I got absolutely smashed last night at a party, I have no idea how much I drank but I was pretty much paralytic. The music wasn't loud and I didn't knock my head badly, but now everything seems very slightly higher in pitch like less than a semitone but it is still really strange. E.g. The doorbell, my ringtone, jingles on the TV, they all sound as if they have been raised very slightly in pitch. Other than being hungover I feel fine. Could this be due to being dehydrated or something?
3 AnswersOther - General Health Care10 years agoRepeat prescription help?
I was prescribed fluoxetene by a doctor who works with my psychotherapist at a hospital near to me. I collected the medicine at my local chemist and am about to run out of it. I am supposed to keep taking it until my psychotherapist and his colleague says so. What do I do to get more?
1 AnswerMental Health10 years agoIs my Bran Flakes addiction bad for me?
I eat them for breakfast, with lunch, with tea and after dinner pretty much every day. I never have less than 3 bowls usually daily.
4 AnswersDiet & Fitness10 years agoWhat are your favourites out of my favourite baby names?
Girls:
Orsola
Claudia
Janet
Sia
Ellen
Boys:
Scott
Bailey
Colin
Austin
Stanley
Stephen
11 AnswersBaby Names10 years agoProzac/Fluoxetine and your opinion?
I've recently been prescribed the drug in aid of reducing anxiety and depression. I have been taking a daily dose for about 4 days now and have experienced some of the side effects. These include headaches, loss of appetite and loss of sex drive.
I have been very sceptical from the start about how effective the drug is, and originally did not want to try it, however I decided there would be no harm as I could always stop at any time.
I would like to hear from people who have tried Fluoxetine/Prozac, and how well it went for you. Thanks.
2 AnswersMedicine10 years agoCaffeine negative side affects?
I stopped drinking coffee for 2/3 months after drinking it for about a year and now I have started again. I have always been quite sensitive to caffeine and my eyelids are twitching like crazy. Anybody else experience this?
4 AnswersDiet & Fitness10 years agoAre my A Level subjects too 'soft?'?
I'm expecting about 4A 4B and 4C grades for GCSE and I have no idea what I want to be when I am older. My A Level choices are:
Maths
Music Tech
Economics
Computing
Should I change economics for English or something like that? I'm expecting A grades for my English GCSE.
4 AnswersOther - Education10 years agoLife gets worse as you get older?
They say that being a child is the best time of your life and people wish they were children again.
I am just starting college and also beginning to understand why people say these things. It seems that as you get older, the world becomes less magical, the things you worry about become very serious, and there are considerably more problems resting on your shoulders. Work, relationships, family, future, health, money… the list goes on. Yes you do have support from your family, but the idea that for the rest of my life I will be a slave to provide for not only myself, but my partner and possibly even children scares me.
I understand that children wish to be adults as adults wish to be children, so this could just be a "you don't appreciate things until they are gone" issue. And I also appreciate that I should choose a career that I enjoy, but that does not matter to me really. It is the idea that if I do not work, I can not really survive in the society I grew up in that matters. One more thing I understand is that is my choice whether or not to have children, but It is is the worries that comes with it that bothers me. E.g. Being a good parent, making the right decisions, organising schedules and the emotional impact it has on me. (There are still many other factors that contribute to my worries that I haven't included.)
There is a lot more I could add to this that I am afraid of like the stresses and strains of everyday life. Having to spend money you have saved on small expenses such as repairing broken possessions, replacing items and decoration of your home etc. I ask for someones opinion who has experienced adulthood. Does it really get worse? Should I be afraid? Am I just being pedantic?!
Thank you <3
6 AnswersPsychology10 years agoIs it against our biology to get married?
So many people divorce so often, and it seems to me that there is only two kinds of "love" feelings between people. Lust and love/friendship. People at nightclubs that you take home are people you lust for and just want the one sh*g with which seems natural as it is written in us to procreate when possible. Whereas people you meet and are obsessed with you feel love for and want to spend a long time with. However this is only to have many children with and lasts about 5 years (honeymoon period) Many couples after this period lose interest so it makes me ask the question Is it against our biology to get married?
2 AnswersBiology10 years agoAm I going to grow any taller than 5 foot 6 at the age of 16?
I am a 16 year old white British male who hit puberty at a very young age (around 9) and I am barely 5 foot 6. I have pretty much stopped growing since I was 14-15. Will I grow any more?
It would be nice to be around 5 foot 7. I know people say you grow until you are 21, but i was an early bloomer, so I am unsure as to how much more people can grow after finishing puberty. Any help much appreciated.
3 AnswersMen's Health10 years ago