Answer:
We use hexadecimal numbers primarily because they provide a more human-friendly representation and it is much easier to express binary number representations in hex than in any other base number system.
Explanation:
HELP HELP HELP HELP HELP HELP HELP HELP HELP HELP HELP HELP HELP HELP HELP HELP HELP HELP HELP HELP HELP HELP HELP HELP HELP HELP HELP HELP HELP HELP HELP HELP HELP HELP HELP HELP HELP HELP HELP HELP HELP HELP HELP HELP HELP HELP HELP HELP HELP HELP HELP HELP HELP HELP HELP HELP HELP HELP HELP HELP HELP HELP HELP HELP HELP HELP HELP HELP HELP HELP
Answer:
I should be C! :D
Answer:
B
Explanation:
Name:
Computer Science
Modified
Python Coding Section C
Directions: Circle the best answer.
1. If the code below, what is the maximum amount of gold that can be in a treasure chest?
def treasure_chest():
gold = random.randint (1, 10)
print ("the treasure chest contains", gold, "pieces of gold.")
#Main program begins here
import random
player_gold = 5
print("There is a treasure chest here.")
treasure_chest()
+ None
C. Five
b. One
d. Ten
2. What is the output of this program?
def say_hello() :
print("Hello World)
say_hello)
say_hello
a. Hello world! Hello world!
b. "Hello World" "Hello World!"
C. Hello Hello
# None of the above
Answer:
The max Number would be D. TEN
Explanation:
Where it say the main program begins is where the use of import random is be using under the treasure chest function basicly the random.randint choose and random number between 1 through to 10..
multimedia computer system required the following hardware component they are what
someone, please answer this.
This lesson showed you the general form of the syntax for a for loop in JavaScript:for
(initialize counter; condition; update counter) {code block;}
What does each part do, and why is it necessary?
Answer: A loop will continue running until the defined condition returns false . ... You can type js for , js while or js do while to get more info on any of these. ... initialization - Run before the first execution on the loop. ... But it can be used to decrement a counter too. statement - Code to be repeated in the loop.
Explanation:
Implement the function printTwoLargest that inputs an arbitrary number of positive numbers from the user. The input of numbers stops when the first negative or zero value is entered by the user. The function then prints the two largest values entered by the user. If fewer than two distinct positive numbers are entered a message to that effect is printed instead of printing any numbers. Hint: Duplicates will cause problems. Try to make sure that you find a way to ignore them.
Answer:
The function in Python is as follows:
def printTwoLargest():
chk = 0
list1 = []
num = int(input("Enter: "))
while num > 0:
for i in list1:
if i == num:
chk+=1
break;
if chk == 0:
list1.append(num)
chk = 0
num = int(input("Enter: "))
list1.sort()
if len(list1) >= 2:
print("Largest:", list1[-1])
print("Second:", list1[-2])
else:
print("Length of list must be at least 2")
Explanation:
This defines the function
def printTwoLargest():
This initializes a check variable to 0
chk = 0
This initializes an empty list
list1 = []
This prompts the user for input
num = int(input("Enter: "))
The following loop is repeated until input is 0 or negative
while num > 0:
The following for loop checks for duplicate
for i in list1:
if i == num: If duplicate is found
chk+=1 The check variable is set to 1
break; And the for loop is exited
The input is appended to the list if the check variable is 0 (i.e. no duplicate)
if chk == 0:
list1.append(num)
This sets the check variable back to 0, for another input
chk = 0
This prompts the user for another input
num = int(input("Enter: "))
This sorts the list
list1.sort()
This prints the two largest if valid user input is 2 or more
if len(list1) >= 2:
print("Largest:", list1[-1])
print("Second:", list1[-2])
if otherwise, this prints that the length must be at least 2
else:
print("Length of list must be at least 2")
Input a list of positive numbers, terminated by 0, into an array Numbers[]. Then display the array and the largest and smallest number in it.
Answer:
hope this helps and mark my ans brainliest if it helped.
Explanation:
def main():
Numbers = []
n = input("Enter the number: ")
while n != 0:
Numbers.append(n)
n = input("Enter the number: ")
if len(Numbers) > 0:
max = Numbers[0]
min = Numbers[0]
for i in range(0, len(Numbers)):
if max < Numbers[i]:
max = Numbers[i]
if min > Numbers[i]:
min = Numbers[i]
print Numbers
print "Largest: ", max
print "Smallest: ",min
main();
Using the drop-down menus, correctly complete the sentences.
A(n)
vis a set of step-by-step instructions that tell a computer exactly what to do.
The first step in creating a computer program is defining a(n)
the next step is creating a(n)
v problem that can be solved by a computer program.
A person writing a computer program is called a(n)
Answer:
It is computer program , Problem, Logic, Programmer
Explanation:
on edge