How to begin!!! | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

How to begin!!!

As I was told, they said you become better as much as you practice! Now, I have written a Python code which receives input from user and perform some statistical operation on the values. 1. It process it and gets the frequency table (this table isn't so fine as I don't know how to create a table with Python yet!) So I had to be printing my results separated with lines E.g | score | Freq | | 12 - 15 | 30 | | 16 - 19 | 16 | etc. So when I have a large data size, the table becomes wobbly. 2. It calculates the mean, median and mode. 3. It calculates the percentile and quartile. I am a beginner!! I believe this task will surely exist in a predefined module, but I just need to do something!!! My main problem I want to make this program better to the extent that I will be able to make it into a mobile app I will really appreciate your contributions. I will also like this post to go viral so I can have a lot of comments, criticism and suggestion to pick from. Thanks everyone! -->

14th Apr 2020, 12:26 PM
Kareem Basit Adeniyi
Kareem Basit Adeniyi - avatar
1 Answer
0
Yeah not gunna go viral but i can help with making pretty tables. ... title = 'Score |Frequency | ' print(title) print('=' * len(title)) for i in whatever: print(f'{value1:>6} |{value2:>6} |') print('-' * len(title)) Really look at the f strings. After the ":" you see a ">" and a "6" in each set of curly brackets. The ">" pushes the value to one side and the "6" says how wide the cell is. might need some fine tuning but thats a table for ya
14th Apr 2020, 2:27 PM
Slick
Slick - avatar