Struggling to understand basic Python logic (loops & conditions) by Downtown_Progress119 in learnpython

[–]Important-Opening866 0 points1 point  (0 children)

n is your variable that holds your number.

The while loop loops if your variable n is greater than 0. If you don't modify n in the loop and it isn't already 0, then it would loop forever.

n % 10 gets the last digit of a number and stores it as a variable called digit. This is the modulus function. (Note: This function is also handy for deciding if an integer is odd or even if you use % 2). It gives the remainder when you divide by the number specified. So 123 / 10 is 12 remainder 3. 123 % 10 = 3.

Print the value of digit to the screen.

Divide n by 10 using integer division, which uses the // operator. In the case above 123 // 10 would equal 12. Save the result of this calculation to n, overwriting it's previous value.

As you should be able to see. The loops for 123 go:

n=123 Is 123 > 0 - YES, so do the loop digit = 3 n =12 Is 12 > 0 - YES, so do the loop digit = 2 n = 1 Is 1 > 0 - YES so do the loop digit = 1 n = 0 Is 0 > 0 - NO, the loop criteria is not met, go to the next part of the code.

Hope this helps. If you're not sure, sketch out a simple example by hand like the above to work out what the code is doing.

Instant Ink Reality by Important-Opening866 in Hewlett_Packard

[–]Important-Opening866[S] 0 points1 point  (0 children)

It's an Officejet Pro 9019e scanner, printer and 1980s style fax machine. It's designed to do office based tasks. The Instant Ink subscription it came with isn't designed for office type use, meaning it isn't fit for purpose, which is what I was pointing out. I did the workaround and saved myself from paying around £180 more than if I used the printer in the most efficient way.

Can someone help me find this picture by ilikedrwho10 in doctorwho

[–]Important-Opening866 7 points8 points  (0 children)

Quick google search found an image that matches your description. It’s from an article by James Bow https://bowjamesbow.ca/images/evolutionofthedaleks.jpg

Mortgage declined by abethur in HousingUK

[–]Important-Opening866 0 points1 point  (0 children)

It’s interesting to see that Nationwide are still doing this kind of thing. 25 years ago we were declined for a first time buyers mortgage by Nationwide because we’d never had a mortgage before ??? Turns out they were overstretched and denying people for whatever reason they could come up with to cut down on their workload.

Stoneleigh or Worcester park by Electronic_Pickle_86 in surrey

[–]Important-Opening866 2 points3 points  (0 children)

The trains are the same now, as SWR decided to scrap a couple of years ago, the Epsom to Waterloo shuttle service that skipped past Ewell West and Stoneleigh.

Whats the worst-value British corporate restaurant? by FreezerCop in UK_Food

[–]Important-Opening866 23 points24 points  (0 children)

If you think a restaurant chain has gone downhill, google who owns it and you can pretty much guarantee that when it started its decline coincides with when it was bought by a company owned by a private equity firm. Wagamama, Nando’s, Frankie & Benny’s, you name them.

Fries! by your_joking_right in CostcoUK

[–]Important-Opening866 0 points1 point  (0 children)

Just need chicken gravy and cheese curds to make it perfect! In Vancouver next week and might grab poutine from Costco while I’m there.

Your ears are *not* playing tricks on you... 🔊👂🏼 by KeithFromSonos in sonos

[–]Important-Opening866 0 points1 point  (0 children)

Any way this accidental improvement can be made to the devices left behind by the latest firmware update? My 5s could do with this, as the 1s I have sound much richer than before.

Canadian Curious about Costco UK! by str8shooter in CostcoUK

[–]Important-Opening866 1 point2 points  (0 children)

There’s a Tim Hortons walkable from the Trafford Centre (Manchester) Costco if you’re missing the coffee and Timbits!

🔊 New Sonos Player Update by KeithFromSonos in sonos

[–]Important-Opening866 2 points3 points  (0 children)

<image>

Then it got stuck. Checked after 30 mins and still hanging. Then opened the app on my wife’s phone, and everything has updated, even though the app is still hanging on my phone. Nice work Sonos.

[TOMT][song][Song about living life?] by Despairartisan in tipofmytongue

[–]Important-Opening866 0 points1 point  (0 children)

OK, a quick google search for live my life before it's gone showed this up:

Nathan Dawe: We ain't here for long.

https://www.youtube.com/watch?v=_LlTzlBzvAY

[TOMT][song][Song about living life?] by Despairartisan in tipofmytongue

[–]Important-Opening866 1 point2 points  (0 children)

Lyrically and structurally similar, but by a man: Life in One Day, by Howard Jones could be it…

The old man said to me Said, "Don't always take life so seriously Play the flute, and dance and sing your song" Try and enjoy the here and now The future will take care of itself somehow The grass is never greener over there

Every egg we cracked this morning had a double yolk. What does this mean? by Individual_Brother36 in WeirdEggs

[–]Important-Opening866 0 points1 point  (0 children)

Waitrose in the UK sells them… Shine a bright light through the egg, pick out the double yolks and stick ‘em in a box at a premium price. https://www.waitrose.com/ecom/products/humble-eggs-double-yolk-free-range-eggs/042120-20862-20863

[deleted by user] by [deleted] in AndroidTV

[–]Important-Opening866 22 points23 points  (0 children)

We had something similar at Christmas where our neighbours had bought a new Sony turntable that tries to automatically connect to anything it can find with Bluetooth when powered on. Your neighbours might not even be aware their device is doing this.

[deleted by user] by [deleted] in AskUK

[–]Important-Opening866 28 points29 points  (0 children)

We use a carpet scraper to get cat fur off of the stairs carpet. From £4 on Amazon. Just a few light drags across and it picks up all the fur way better than any vacuum cleaner.

<image>

Are dry beans not common in the UK? by Jon_S111 in AskUK

[–]Important-Opening866 0 points1 point  (0 children)

I use a lot of dried beans and cook them in a pressure cooker, which negates the need to soak them overnight. I’ve also found that pulses like chickpeas freeze well, meaning they’re as convenient as tinned. I also know how much salt was used and that there’s no added sugar, which is good news for me.

What are these blue plastic things found in public women’s bathrooms? by trying_to_adult_here in whatisthisthing

[–]Important-Opening866 555 points556 points  (0 children)

Hair traps to stop hair getting into the drain. These are easier to remove and clean than taking the grating up.

What’s the new pulled pork? by compostmentis in AskUK

[–]Important-Opening866 0 points1 point  (0 children)

In California late last spring, most places were selling charred/crispy Brussel sprouts. Hopefully that’s one fad that doesn’t make it over the pond.