Python Programming

Statements and Expressions

Computers as machines deal work with data. Data is processed by the computer under the control of a program.

The program takes the data as input, processes it and produces an output.

The code that powers the programs does so using statements and expressions.


A statement is an instruction that tells the computer to do something. They carry out an action in the code for a computer program.

On Day 1, you used the assignment statement. The assignment statement is represented by “=”. When you created a variable, the assignment statement is used to set its value.

An assignment statement associates a value with a variable.

Another assignment statement we have seen so far is the print statement. The print statement displays a value placed within it by the user.


An expression is a piece of code that returns data. Expressions are a sequence of values, joined by operators that can be simplified to other values.

For example, 2 + 2 is an expression representing the value 4.

Expressions are evaluated by the Python interpreter. If you type in an expression into the Python interpreter, it evaluates it and displays the result.

Statements and expressions in the Python programming language

The first line is an expression that has a value of 5. When 1 + 1 is added, we get 2 so that is also an expression.

x = 5 is the assignment statement in action. x = x + 1 will take the current value in x on the right-hand side and add 1 to it. Then assign that value back to x.

The print statement displays the value in the x variable which is 6.

Lockdown Chronicles

Lagos Lockdown Day 4

A pretty uneventful day on my end. I stayed home the whole day. Apart from my neighbour whose generator is still on despite the electricity being back on, I don’t have much to complain about.

Nigerians leaders have shown that they lack creativity or imagination. All the other nations that implemented lockdowns have functioning infrastructure.

This lady describes the pain of staying at home with a blackout. I remember that we had to throw away a pot of soup at home.

Remember the incident in Warri, well a punitive mission is on the way. The soldiers have made a video stating their intentions to rape the women in the state.

Sad because anyone who knows the story of the atrocities of the army in Asaba during the Nigerian civil war would be distraught.

There is talk about the lockdown being extended but I hope not.


COVID Pledge

Today marks Day 4 of the Lagos Lockdown. As I write this, the noise from the generator at home is intruding. There has been no light since yesterday when we had a blackout.

In my part of Lagos, Nigeria we are on “One Day On, One Day Off”. A polite term for load-shedding.

I am tired of the noise and would love to leave the house. Sadly I cannot. In a country where youths are harassed by the police on normal days of the week, violation of the lockdown would be suicide.

With the lockdown in place, the security services have been given a license to kill. 3 people have already lost their lives due to the enforcement of the lockdown. Only 1 person has died from the virus.

Yesterday, Nigerians realised that there are no ventilators in the country. The incidence exposed the underbelly of the Nigerian elite.

On all front, the current administration is a failure. The entire situation is being handled poorly.

I am in a shithole of a nation with the realisation that I am at risk. I feel like a passenger on a plane that the engines have gone out.

On April 1st, I was morbid. I had given up hope for living. On the second, I was looking for words to help me die well.

Today, I have a vision for the future. Without a vision beyond the current events, it is possible to be overwhelmed by them.

The Federal government of Nigeria would be begging Elon Musk after getting N44 Billion in donations.

The dilapidated hospitals in the country have no equipment. Unlike other nations where every citizen can get government aid, Nigerians will have to rebuild their lives when all this is over.

I have decided that I will live through this period. These are dark times but I have decided that come what may, I will survive.

A verse in the Holy Quran says: “The death from which you flee will truly overtake you”.

In my life, I testify to the truth of those words. Everything I have been afraid of has happened to me. It’s as if by being afraid of something, I attract it to myself.

But not this time. This time I have chosen a vision for the future. I got the inspiration to create a framework for the COVID-19 Pandemic which I call the COVID Pledge.

C – Change

Once the skies clear, I will go back to making. I used to be a maker until I had an accident in 2015, then I gave up on living.

Once the lockdown is over, I will go back to making stuff. The first thing I would want to make is an Antisoud device of some sort.

O – Optimise

I teach virtual classes. It is my sincere belief that the classes could be done better. At the moment I am working with the second batch of students for the Learn to Code Monthly Series.

I intend to continue working on making the classes better until I am satisfied with my results.

Once I am sure that I have a system in place, I will look at how to automate as much of the process as possible.

V – Visit

My favourite country on earth is Ghana. It would be there that I would learn that my “Nigerian” mentality was depravity.

Once the pandemic is over and it is possible to travel again, I will visit Ghana. My plan is to go as far as Ivory Coast. I have been working on a series to draw Adinkra symbols using the Python programming language.

Being able to visit Ghana then Ivory Coast will help me complete the book I intend to write about the Adinkra symbols.

I – Initiate

This year marks 10 years since I created my first game. It was a J2ME game written in the Java programming language.

Fuelled by youthful exuberance, I would try to build a game studio in Nigeria.

Inexperience, a lack of capital, the absence of payment infrastructure and hubris would turn a dream into a nightmare.

The accident in 2015 ended that dream. As soon as it is possible, I will reopen the company. The goal would be to create products that I feel are needed in this world. I will work on it part time.

D – Destroy

I will use this platform to speak up against the wrongs in my country. I have always said that “Bad governance will kill everyone”. The Coronavirus debacle is proof of that.

For far too long Nigerians have gotten the short end of the stick when it comes to governance. Enough is enough.

You Have a Choice to Make

Without aspiration for the future, all is lost. By having a vision beyond the headlines of today, you increase your chances of coming out of the pandemic.

The COVID Pledge is a framework for thinking positively about the COVID-19 Pandemic. If you have read this far, I urge you to create one for yourself. There is no need to share it with anyone.

For the most part, the headlines in the remaining part of the year will not be positive. Even if the pandemic ends today, the world faces the task of rebuilding.

A key piece of advice to preventing the spread of the Coronavirus is to maintain social distancing.

However, nowhere are we told to protect our minds. News flies fast and furious as news agencies compete to outdo each other on negativity.

As at today, 1 million people have been infected. It’s hard to insulate yourself from that news.

However, this battle will be won or lost in your mind. By controlling your thoughts you increase your odds of survival.

By making your own COVID Pledge, you affirm your will to survive and your faith in the future.

Take this period to renew yourself. Learn a new skill. There are a lot of free courses available right now. A lot of paid courses are being given away for free.

I will end this post with a verse from the Holy Bible: “I am giving you a choice between life and death. Choose life”.

Words on Marble

If We Must Die

If we must die, let it not be like hogs
Hunted and penned in an inglorious spot,
While round us bark the mad and hungry dogs,
Making their mock at our accursèd lot.
If we must die, O let us nobly die,
So that our precious blood may not be shed
In vain; then even the monsters we defy
Shall be constrained to honor us though dead!
O kinsmen! we must meet the common foe!
Though far outnumbered let us show us brave,
And for their thousand blows deal one death-blow!
What though before us lies the open grave?
Like men we’ll face the murderous, cowardly pack,
Pressed to the wall, dying, but fighting back!

A Poem by Claude McKay

Lockdown Chronicles

Lagos Lockdown Day 3

The above image is the consequence of the show of shame witnessed on Twitter today when Elon Musk put out a call for hospitals that needed ventilators.

The shameless Nigerian government who had collected huge amounts in donation scored a home goal by choosing to also make a request.

The outpouring of emotion soon became a flood as people started responding to the tweet. A copy of the tweet is shown here for posterity.

Ministry of Finance, Budget and National Planning begging Elon Musk for ventilators.

Having compromised the wealth of Nigerians in the last 5 years, the handling of the Coronavirus incident in the country would leave a lot to be desired.

Yesterday, I became morbid. I have accepted that I cannot escape the coming onslaught. As a result of this, I am no longer afraid to say my mind.

The entire debacle of the Coronavirus has shown the underbelly of the Nigerian elite.

The image below shows the amounts of money donated at this point in time.

COVID-19 Donations

The entire basis of the request is meaningless if the donations of money haven’t been diverted. Of what use is begging when over N44 Billion Naira has been donated.

Despite dissenting voices that the poorest nation on earth couldn’t handle a shutdown, the government would go ahead and enforce it.

In Lagos, members of the taskforce were more civil as they went about enforcement. However, In Delta state, a soldier shot a man.

Youths in the state would retaliate triggering a very violent protest that would cost a soldier his life.

Now we are all stuck here on the Titanic as it takes on water. None able to run away. The rich will now get a chance to make a first-hand assessment of health facilities in Nigeria.

I have no empathy left for myself or anyone. The carnage the Coronavirus could wreck on the country is yet to be unleashed.

The onslaught is just beginning.