I'll Run To You

I'll Run To You

"But if you send for me, you know I'll come,
And if you call for me, you know I'll run,
I'll run to you, I'll run to you, I'll run, run, run..." - Lana del Rey, Old Money

A tall pylon stands above a green field and trees against an open blue sky.
A photo of a pylon from my beautiful and beloved and dear, dear friends near Prague, Czechia!!!

Old Money smashes my heart open every time.

It's 8 am on a Tuesday and I'm on the train to London. I have created a project board for all of my side learning projects.

I am reading two books, doing two courses and have a couple of homeworks from my mentor (mostly old ones; we are toning down the homeworks for now as I focus really hard on my day job and making it work for me - I am an excellent software engineer, I believe, but from a neurodiversity perspective it requires some adaptation. Especially from my end - I have to get used to the job!). But all I feel like doing is solving a codewars problem.

So naturally, I did the Jaden Smith problem

OMG I SOLVED A PROBLEM THE FANCY WAY

OMG OMG OMG OMG I DID IT. I DID IT. I SOLVED A PROBLEM THE FANCY WAY. I DID IT IN A ONE LINER WAY IN PYTHON. I DID IT IN A FANCY WAY. YAY YAY YAY HOORAY. There is always a fancy way to do it! WOW! I've come a long way from being a little Italian student at Warwick ;) there was a very very long long way to come. xx
def to_jaden_case(string: str) -> str:
    return ' '.join(word.capitalize() for word in string.split())
AND IT WAS THE TOP SOLUTION AGAIN! OMG. x

So here was my solution - and so what was it that it did please? thanks

  • It takes in a string
  • it returns a string
  • it joins a string by a space ' ', spacing each word apart by one space ' '
  • Inside of the brackets, I have a generator expression
  • YES! YES I KNOW! I DID IT! I KNOW

I USED A GENERATOR EXPRESSION! 

I know! I did it! I know I know I know!
  • So what happens inside the generator expression?
  • we start with the 'for' keyword
  • so 'for' every word in the string - well list, why? - because we call .split() on the string and so it is a list now
  • so for every word in the list
  • we capitalize() the word
  • which renders the first letter of the word a capital letter
  • that's what capitalize() does
  • and so then we join list back into a string
  • and then we return it as a string, please - thank you!

Everything I do, I do it for the pylons

Everything I do, I do it for the pylons.

Because pylons are the most magical thing in the world. When I look at pylons I see magic, I see God. I see sparks fly.

Hello from Hassocks.

When I moved to the UK then I stayed in a hotel near London City airport overnight. There were so many pylons everywhere. And I knew that I was following my destiny.

I felt that I was following my destiny.

I am following my destiny.

I am following my destiny.

I am following my destiny.

Thank you.



Comments

Popular posts from this blog

Hello World

Yosemite

Two Lines of Thought, Makes Me Wonder What I'm Missing