1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
xenn [34]
3 years ago
7

Assume the availability of a function is_prime. Assume a variable n has been associated with positive integer. Write the stateme

nts needed to find out how many prime numbers (starting with 2 and going in increasing order with successively higher primes [2,3,5,7,11,13,...]) can be added before exceeding n. Associate this number with the variable k. SUBMIT
Computers and Technology
1 answer:
My name is Ann [436]3 years ago
5 0

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:

You might be interested in
HELP PLSSS I WILL MARK U!!!!
Stels [109]
Biology maaaan. I honestly forget
8 0
3 years ago
Read 2 more answers
What type of an attack is being executed if an attacker substituted an invalid mac address for the network gateway so no users c
Fudgin [204]

ARP poisoning If an attacker changed the network gateway's MAC address to an incorrect one so that no users can access external networks, the attack is being carried out.

<h3>What is the MAC address of a device?</h3>
  • A network interface controller (NIC) is given a media access control address (MAC address), which it can use as a network address in communications inside a network segment.
  • Ethernet, Wi-Fi, and Bluetooth are just a few of the IEEE 802 networking technologies that frequently employ this application. Your home network's devices each have a distinct MAC address.
  • Each network adapter on your computer that has its own MAC address, such as an Ethernet adapter and a wireless adapter.

To learn more about  MAC address, refer to:

brainly.com/question/24812654

#SPJ4

4 0
1 year ago
What do we call the software program that handles the communication between a peripheral device and your computer?
insens350 [35]

Answer:

a. Device Driver

7 0
3 years ago
Read 2 more answers
In order for bitlocker to protect the system volume without the aid of an external drive, your computer must:
zhenek [66]
70% C, 20% B, 5% / 5% - A /B
4 0
3 years ago
Read 2 more answers
What field in an IPv4 packet is altered to prioritize video streaming traffic over web surfing traffic?
Serhud [2]

Answer:

DiffServ (Differentiated Service)

Explanation:

DiffServ (Differentiated Service) field is used to prioritize traffic in IPv4 packet.

DiffServ is used as QoS (quality of service) on networks at Layer 3, replacing former IPv4 TOS field to effectively deal with the web traffic and prioritization issues starting from 1998.

3 0
3 years ago
Other questions:
  • In internet terminology, what is the term, .com, called?
    12·2 answers
  • 5. In Access, data is stored in a _______ once a form is completed. A. cell B. page C. record D. form
    13·1 answer
  • When you right-click certain areas of the Word or other Office app windows, a command menu will appear. Group of answer choices
    13·1 answer
  • How do i unblock website on my school computer
    7·2 answers
  • This program will output a right triangle based on user specified height triangleHeight and symbol triangleChar. (1) The given p
    14·1 answer
  • When developing e-business systems, an in-house solution usually requires a ____ for a company that must adapt quickly in a dyna
    11·1 answer
  • Waygate's residential Internet modem works well but is sensitive to power-line fluctuations. On average, this product hangs up a
    6·1 answer
  • Strengths and weaknesses about esport
    10·1 answer
  • In your own words, what is Cryptocurrency?
    15·2 answers
  • What is e banking effects
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!