There are a wide range of software that can be used on a computer system and these can be grouped in three main categories:
- Operating System: The Operating System (OS) is the foundational software that manages a computer’s hardware and software resources, providing a platform for other software to run (e.g., Windows, macOS, Linux).
- Utility Software: Utility Software includes tools designed to maintain and optimise the performance of the computer, such as antivirus programs, disk defragmentation software, and file management utilities.
- Application Software: Application Software consists of programs designed for specific user tasks, like word processors, web browsers, graphic editing software and video games, enabling users to perform activities on the computer.
For this challenge we will consider a deck of cards where each card represents a piece of software. The game will consist of randomly selecting three cards from the deck and revealing them to the player:
Based on the card selected, the player may score points as follows:
Python Code
We have started the code by first creating three lists, each of these listing 6 different pieces of software:
OS = ["Windows 10","Linux","MacOS","iOS","Android","MS DoS"] utilities = ["Anti-Virus Software","Firewall","Encryption Software","File Compression Software","Disk Defragmentation Software","Backup Software"] application = ["Word Processing Software","Presentation Software","Spreadsheet Software","Web Browser","Graphic Editing Software","Video Editing Software"]
Then we are creating a full deck of 18 cards by combining all three lists into a single list.
software = OS + utilities + application
Using the random library, we can easily pick a random software card from our list of software:
import random card = random.choice(software)
We can easily check what type of software our card by checking if it belongs to one of the three sub lists:
if card in OS: print(card + " is an example of Operating System.") elif card in utilities: print(card + " is an example of Utility Software.") elif card in application: print(card + " is an example of Application Software.")
You can check the following code below. Your task is to complete this code to implement the card game with its scoring system and making sure the player can repeat the process of picking three cards randomly as long as they wish to.