import random
computer_choice = random.choice(["rock", "paper", "scissors"])
user_choice = input("rock, paper, or scissors? ")
if computer_choice == user_choice:
print("It's a draw!")
elif user_choice == "rock" and computer_choice == "scissors":
print("You win!")
elif user_choice == "paper" and computer_choice == "rock":
print("You win!")
elif user_choice == "scissors" and computer_choice == "paper":
print("You win!")
else:
print("The computer wins!")
I wrote my code in python 3.8. I hope this helps.
Answer:
All the procedure is explained below step-by-step
- Press alt+F11 to open VBA in excel.
- Create a module and start entering the subroutine.
- The coding of subroutine is attached in the image.
For adding "RUN" button:
- Select a shape on the sheet for the button.(Insert > Shapes > Rectangle).
- Double click on the shape to add text and write "RUN".
- The button can be styled by adding colors and shadows.
- Now Assign macro to the button (Right click > Assign macro).
- A window pane will appear, select the macro from This workbook list so that it may work properly when shared with others.
- Press OK.
- "RUN" button has been created and by pressing it the subroutine will work as required.
Keep it simple... it holds whatever info' you want. would he/she understand?
Answer:
The answer to this question as follows:
Explanation:
- In the given code an integer pointer variable "intPointer" is declared, this variable holds an integer type value, which is "500". In the next step, the pointer variable initialized a value with 10, which is illegal, because in pointer we hold the address of variable, not the value, that's why it will give segmentation fault.
- This fault will arise when the common condition triggering crashed systems, it often linked to the main script, that Safeguards are triggered by a program, that tries to read or write an illegal place in storage.
The following are seven basic internal computer components which can be found inside a computer tower;
1. The CPU or Central Processing Unit, it the "brain" of the computer and manages all of the processing tasks.2. RAM or Random Access Memory.3. The Motherboard, which allows all the internal components to communicate with each other. 4. The PSU or Power Supply Unit.5. The HDD or Hard Disk Drive.6. The GPU or Graphical Processing Unit or Graphics card as it commonly known as.7. The Optical Drive