Visa and MasterCard will be acceptable anywhere. Anything else is likely to be problematic as the card company charges higher fees to the retailer - certainly charge cards such as American Express and Diners Club will NOT go down well.
The UK uses a chip and PIN system. This is designed to reduce fraud from forging a signature. The normal way to pay with a card in the UK is to insert it into the terminal at the checkout, follow the instructions on the little screen on the terminal and tap in your PIN. If your card doesn't have a chip (it looks like a SIM card showing through on the front left of the card), they'll print out a slip for you to sign instead. Another consequence of this is that without a chip, your card may not work in British ATMs - not that getting a cash advance on your credit card is anything you should ever consider doing except in emergency because of the high interest rate.
For 5 months, see if you can open an account - maybe just a basic one that just gives you a debit card and doesn't allow overdrafts - with a British bank. Then you've got a chip and PIN card. Or see if there is any way you can get a prepaid debit card with chip and PIN.
Basic accounts got introduced a while back when the government decided to save money by paying social security benefits directly into bank accounts instead of issuing cheques - our spelling of checks - or paying out cash at post offices. Oh, the squeals and the moans... but it's accepted now, my mother (aged 75) gets her state pension paid this way instead of the way her parents got theirs by having to go to the post office every week with their pension books to collect the cash, and basic accounts exist for people on benefits with bad credit. The introduction of those made paying benefits by bank transfer possible. You just have a debit card, no cheque book, and can't go into overdraft.
Then the banks had another idea... because with a debit card that has chip and PIN it can be electronically checked every time whether there's enough money in the account to pay, we can do this for children who aren't legally old enough to have an overdraft. Let's catch 'em young... and now children as young as 11 can have a basic account.
Get used to this and you might start to think that US banks and stores should go for chip and PIN as well. It's so quick. Card in, tap tap tap tap, Enter, take your card out when the screen says, done. It even works in restaurants - the waiter can bring a wireless terminal to your table for you to insert your card and tap in your PIN. One result of it in the UK is that shops and stores no longer accept cheques, and cards get used for even small transactions. I do it every time I go food shopping. The UK banks have even proposed abolishing cheques completely, and certainly I hardly ever need to write one, but that has been squashed for the moment as there are non-personal customers who still need to use them.
The latest thing is contactless cards. My debit card isn't but when it expires next year I bet the replacement will be one. These don't even need a PIN. Touch your card on the terminal and you've paid. Londoners are used to this as this is how the Oystercard to pay for public transport works, but now that contactless cards exist, if you have one you don't need Oyster except if you want a long-period ticket.
Talking of London public transport, Oyster is the main way to pay and ticket offices are dying out because you can get everything you need from ticket machines or local shops that sell Oystercards. Transport for London's aim is to close ticket offices completely. Cash fares were abolished on London buses back in July and the only way to travel on them now is Oyster, contactless card, or buy a day Travelcard that you show to the driver.
Visa and MasterCard are accepted virtually everywhere, including all ATMs. AmEx is less common, and mainly accepted in travel (hotels, airlines, etc.) and major retail outlets like department stores. The Discover Card is the least likely to be accepted. Or possibly Diners Club - can't remember the last time I even saw that!
Visa and Mastercard are the most widely used. Cards in the UK are chip and pin, some shops will let you sign, but it's up them whether you can or not.
As others have said, Mastercard and Visa are really the only cards. Amex charges retailers a higher margin so is not commonly accepted.
You must have a PIN, retailers are not covered for fraudulent use when the 'customer' signs the receipt, so most will decline.
I use my Visa when I go to England. It's helpful if your card as a chip as well as the magnetic strip as their machines are all designed to use the chip.
ANY VISA ,Mastercard or Amex....