+14

Weres my Umbrella? [Challenge]

Ok, So my mum has a habit of going to work with an umbrella when its raining and leaving it at work if its sunny before she finishes. If its raining the next day she will have to go to work without an umbrella as shes left it at work so i made a challenge out of it 😜 please see below code for details. The code font size was set to small. https://code.sololearn.com/cZ5ka8bAyKBN/?ref=app

2/13/2018 12:16:47 PM

D_Stark

7 Answers

New Answer

+19

Oneliner... https://code.sololearn.com/cLG7JHQz70FL/?ref=app

+7

I've updated the code to make output more compact https://code.sololearn.com/c9sWY3R8WBZ3/#py

+5

The program should start at home with a umbrella if the weather is sunny the umbrella never moves it only moves if its raining and thats only if the umbrella is at the place shes leaving if not then she walks in the rain back to home were the umbeller was left. does thar make sense?

+5

@ Tato weather is random for 3 days or more if you want ☺

+4

https://code.sololearn.com/cFeOhGR3A3Qr/?ref=app

+2

So the weather is random?

+2

https://code.sololearn.com/cv67rd2LZ8y0/?ref=app