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
faltersainse [42]
3 years ago
3

In Python please:

Computers and Technology
1 answer:
Lyrx [107]3 years ago
5 0

Answer:

n = int(input())

total = 0

for i in range(0, n):

   if is_prime(n):

       total += n

print("Total of first", n, "primes is", total)

Explanation:

Define n as an input variable, simply iterate through all numbers from 0 to n, adding them to a running count if the number is a prime as defined.

If you need code for checking if a number is prime - then please let me know.

Hope this helps!

You might be interested in
Write a program that asks for a password and then verifies that it meets the stated criteria. • If the password meets the criter
inessss [21]

Missing Details in Question

The password criteria are not stated. For this program, I'll assume the following

  • Password must contain at least 1 capital letter
  • Password must contain at least 1 small letter
  • Password must contain at least 1 digit
  • Password must be at least 8 characters

See Attachment for Source File "MyName-Hwrk10A.cpp"

Answer:

// Comment explains difficult lines

#include<iostream>

#include<cstring>

#include<cctype>

using namespace std;

int main()

{

//Enter your name here

int k,l,m;

/*

Integer variables k,l and m are used to count the number of  

capital letters small letters and digits in the input string (password)

*/

//Initialize them to 0

k=0;l=0;m=0;

int length;

string pass;

cout<<"Password: ";

cin>>pass;

//Calculate length of input string

length = pass.length();

//The following variable is declared to determine if the input string meets criteria

int det = 0;

for(int i = 0;i<pass.length();i++)

{

 if(isupper(pass[i])){ k++;}

 if(islower(pass[i])){ l++;}

 if(isdigit(pass[i])){ m++;}    

}

if(k==0)

{

cout<<"Password doesn't contain capital letters "<<endl;

det++;

}

if(l==0)

{

cout<<"Password doesn't contain small letters "<<endl;

det++;

}

if(m==0)

{

cout<<"Password doesn't contain digit "<<endl;

det++;

}

if(length<8)

{

cout<<"Length of password is less than 8 "<<endl;

det++;

}

if(det == 0)

{

 cout<<"Password meets requirements "<<endl;

}    

 return 0;

}

Download cpp
4 0
3 years ago
Question 3 10 points Save Answer Many companies in the computer industry introduce new products and services frequently in an at
Setler [38]

Answer: False

Explanation:

Cost leadership infers that the company has the lowest costs in the industry and this allows them to charge people less for their products which would increase sales and therefore profitability.

Introducing new products in the computer industry does not project this image because when new products are introduced, they are typically more expensive in a bid to incorporate the cost of new technology which means that they cannot be cost leaders.

8 0
3 years ago
How do you code to find the surface area 6 s2, volume s3 in python
Nana76 [90]

Answer: you code to find the surface area 6 s2, volume s3 in python

Explanation:if you dont code the surface area 6 s2, volume s3 in python then you  cant code

4 0
3 years ago
What does cramming to hand in an assignment
Vikki [24]
Honestly gotta say cramming in an assignment doesnt help at all

5 0
3 years ago
Henry wants to build a computer that will allow him to run a hypervisor program.
maria [59]

Answer:

<em>High-end video card</em> is not the necessary requirement to run hyper-visor program.

Explanation:

Hyper-visor program is actually a virtual machine operating system, It use the same hardware with two different operating systems using shared resources.

It creates another computer system with different operating system, which can called a virtual machine.

Virtual machine or Hyper-visor program is sharing the following resources:

1. RAM

2. Processor

3. Hard Disk

So, to install or run Hyper-visor program, the above three mentioned resources are needed or having high demand. On the other end it is not necessary requirement of Video Card to run this program.

5 0
4 years ago
Other questions:
  • Which part of an I-statement involves a description of your needs or feelings?
    12·1 answer
  • What is a motherboard?
    7·2 answers
  • How many different messages can be transmitted in n microseconds using three different signals if one signal requires 1 microsec
    12·1 answer
  • Which statement about comments is false? Select one: a. Lengthy comments can cause poor execution-time performance. b. Comments
    7·1 answer
  • What is the value stored at x, given the statements:
    11·1 answer
  • HI brainly friends....<br> Pease thanks my answers I will also thank your answers
    11·1 answer
  • Choose all items that represent essential features of excellent navigation menu design.
    12·2 answers
  • What is the grade, as a percentage with two digits after the decimal point, obtained when you graded this 101-question multiple-
    13·1 answer
  • ......................... and ....................... are two ways to define the text in Inkscape.
    14·1 answer
  • Which protocol is often used in conjunction with ipsec to provide a remote access client vpn with user authentication?
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!