Answer:
def main():
# Accept data from the user
n=int(input('Enter the value of n:'))
k=2;
sum=0
print('The list of the prime numbers are as follows:')
# This loop runs from k to n
while k<=n:
# Call is_prime() method,
# to check whether k is a prime or not
sum=sum+is_prime(k)
k=k+1
print('Sum of the prime numbers:',sum)
# is_prime() Method
def is_prime(k):
prime=0
i=1
# Check k is a prime or not
while i<=int(k):
# Find the factors of k
if (k % i) == 0:
prime=prime+1
i=i+1
# If k as two factors
if(prime==2):
print(k)
return k;
# If k as more than two factors
else:
return 0;
# Call the main() method
main()
Explanation:
Answer:
Information Technology
Explanation:
The discipline that would obtain the most benefit from new technologies such as Artificial Intelligence would be Information Technology. The amount of information that exists on the internet is staggering. Artificial Intelligence works by obtaining as much information as possible, learning from the data gathered, and manipulating the data as needed. This allows Information Technology developers to find patterns in data sets, create virtual assistants, automate tasks, find connections in the data, etc. Therefore, bringing a vast number of benefits from studying and experimenting with such technology.
Answer:
entrance poll
Explanation:
Based on the information provided within the question it seems that the type of poll that the news network is conducting is an entrance poll. This refers to asking question (poll) to people outside of the voting center before they enter to place their vote as opposed to exit poll which is done after the individual has placed their vote.
Answer:
Explanation:
The following code is a Python program that allows you to input 100 marks. You can input the value -1 to exit the loop early. Once all the marks are entered the program prints out the highest mark among all of them. The output can be seen in the attached picture below with a test of a couple of marks.
marks = []
for x in range(100):
mark = int(input("Enter a mark: "))
if mark == -1:
break
else:
marks.append(mark)
print("Max value: " + str(max(marks)))