Answer:
1)
n = int(input("Please enter the length of the sequence: "))
print("Please enter your sequence")
product = 1
for i in range(n):
val = int(input())
product *= val
print("The geometric mean is: %.4f"%pow(product,1/n))
2)
print("Please enter a non-empty sequence of positive integers, each one is in a separate line. End your sequence by typing done:")
product = 1
val = input()
n = 0
while(val!="done"):
product *= int(val)
n += 1
val = input()
print("The geometric mean is: %.4f"%pow(product,1/n))
Explanation:
True it usually shows up with a blue underline
Answer:
b. LinkedHashSet
Explanation:
A LinkedHashSet is an ordered version of HashSet that maintains a doubly-linked List across all elements. When the iteration order is needed to be maintained this class is used. LinkedHashSet maintains a linked list of the entries in the set, in the order in which they were inserted.
Answer:
Option(d) i.e "storing a float in an int" is the correct answer for the given question.
Explanation:
- Typecast is used for the changing the one datatype to the another datatype Their are two types of casting
1 implicit
In this typecast we change the smaller datatype into the larger datatype.
For example
int to float
2 Explicit
In this typecast we change the larger datatype into the smaller datatype in an explicit manner.
For example
float to int.
- in the given question we required the casting in the option(d) i.e "storing float in an int" That's why this option is correct and all other options are incorrect.