Python Forum

Full Version: How should write a command for frequency?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
How should write a command for frequency?
_Frequency of different number of doors (2, 3, 4, and 5)
_Frequency of different fuel types (Petrol, Diesel, CNG)
what have you tried so far?
show code attempts and associated errors.
Don't forget to use BBcode tags
Start by defining "frequency". If there are 27 cars and 9 of them have 2 doors, what is the frequency of 2 doors? If 9 of them are diesel, what is the frequency of diesel. How did you arrive at your numbers. Can you write a Python program that mimics your logic?