Python: Does it Byte?

Natania Allan
Design with code
Published in
3 min readAug 5, 2018

(Week 2)

As week two of class took off, we started with the basics of coding on Python Shell, looking at how we can perform simple operations like addition, subtraction, multiplication, division: finding the quotient and remainder. We also came across the random library and learnt a few functions in this library, random.choice, randrange, randint, etc. and we also went over the len() and how the position of elements within an array begin with the value 0 because the positions start with 0.

I learnt how to import this library, and thanks to my prior experience with coding (Java) was able to understand the functions of this library easily. We printed statements, appended, extended and popped elements into and out of the arrays we had made and we later got started with Python.

We were also quizzed on our attention and learning in the class with some pieces of code, in order to understand the code to see if we would be able to figure out the output for them. I also learnt how to make a file on Atom, as an editor and execute it on Python. There was some confusion initially, because I had to uninstall and re-install Python, and also because of how some commands are recognized on Windows and different ones on MAC.

Working with Python so far, I have enjoyed using it, because unlike Java, it doesn’t require long compulsory statements, and defining variables to use and call certain functions. Python is time saving for the user, which in itself, is a huge factor. It is also convenient to be able to write the code and then on python, call the file to be executed in the succession of the code.

Finally, moving on with our code for the interface, we took the feedback we received for our concept (context of the staircases) which was, to reconsider the game of piano tiles and the safety factor of the stairs (as everyone tends to trip on the uneven stairs) with our games and conversion going on and we have tried to adhere to those suggestions. We are still working around the game, trying to make it a less generic one like piano tiles. Where safety is concerned, we want the game on the stairs to draw the attention of the users to look where they’re walking, and we also want the conversational agent to give the users reminders when there are a lot of students on the stairs to look where they’re walking and to mind the uneven stairs. The other feedback we received on the concept was that it is a very interesting space to work with, because even though we experience it every day, we don’t generally think of climbing the stairs as something that can be fun or interactive.

Our group faced an initial difficulty with the flow we wanted to plan for SHIO, and also because we were trying to plan out the conversational part, keeping the voice based aspect in mind and the sensors that will be used as the first form of input to then generate a conversation from the chat-bot with a greeting to the user/users. We later decided that for the time being, we should put aside the voice based part of the conversational agent and make it a text based input-output interface. Once we did this, we were able to put down on paper, the flow of the conversation.

Where our code is concerned, we were able to code a basic but brief conversation between the user and the Chat-bot, SHIO, enabling the user to enter a text based input, which generates a text based output from SHIO. We have decided to initiate our coding with the interface being text based for the time being, to see how it will work. We listed phrases and responses in two different variables and called these in the ‘if: else:’ statements to test the Boolean output and generate another response. We hope to be able to learn more, and from this, generate an audio based chat bot, that can still allow the user to give an input/response to the conversation initiated by the Conversational Agent.

--

--