Skip to content
Advertisement

How to get the seven segment output side by side in python?

I have written a code to display the seven segment output. Whereas I need to display the output side by side. Say input: 123 , output should display seven segment side by side as below

JavaScript

Here is my logic:

JavaScript

Advertisement

Answer

Try the following:

JavaScript

You need to print the segments side by side, so you should start by printing the top column of all the numbers, the second, and so on. I’m using a list comprehension to join the numbers together for each column.

User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement