import random
rock,paper,scissors = 1,2,3
choice = int(input("Please choose 1 2 or 3: "))
computer = random.randint(1,3)
player_won = False
draw = False
if choice == computer:
draw = True
elif choice == 1 and computer == 3:
player_won = True
elif choice == 2 and computer == 1:
player_won = True
elif choice == 3 and computer == 2:
player_won = True
if player_won:
print("You won!")
elif not player_won and not draw:
print("The computer won!")
else:
print("It's a draw!")
First, I recommend importing at the beginning of your program. Also, you can combine all your same datatype variables in one line. You also need to cast your user choice to an integer so you can compare it with the computer's choice. I wrote the if, elif, and else statements using a boolean variable. I simply wrote all the possibilities that would result in the player winning and this would result in the player_won variable being true. If this is the case, we print to the console, "You won!"
Answer:
Option b = "is stored in ROM to ensure to avoid any infection from viruses. "
Explanation:
In order to to understand the fundamentals of an Operating system in computer one needs to know what the bootstrap program is.
The BOOTSTRAP PROGRAM is first program that will run when the computer is switched on, thus the program( the BOOTSTRAP PROGRAM) will be the program to open the OPERATING SYSTEM.
The device in laptops and personal computers known as ROM is an acronym that stands for Read-Only Memory and it is a storage medium. Because of ROM inability to get Virus it is used in the storage of Bootstrap program.
Answer:
f = open('students.txt', 'r')
Explanation:
In the computing world, a command is an instruction to a computer program to execute a particular task. These instructions might be issued via a command-line interface, such as a shell program, or as a input to a network service as a component of a network protocol, or can be instructed as an event in a graphical user interface activated by the respective user selecting an option in a menu.
the f = open('students.txt', 'r') command line would be used to open a file named "students.txt", There are also various other types of commands for executing different task, for example:
1. ASSOC for Fix File Associations
2. FC for File Compare
3. IPCONFIG for IP Configuration
4. NETSTAT for Network Statistics
5. PING for Send Test Packets
6. TRACERT for Trace Route
7. POWERCFG for Power Configuration
e.t.c.
The answer to the question above is the last option: ETHICAL. The IT code of conduct, which is a written guideline, helps in determining whether a specific action is acceptable or ETHICAL. Basically, the IT code of conduct's purpose here is to maintain that the actions being done to the accepted and proper practices.