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
Brums [2.3K]
3 years ago
6

Input a number and find the square root only if the number entered is greater than or equal to zero.

Computers and Technology
1 answer:
Svetradugi [14.3K]3 years ago
5 0

number = float(input("Enter a number: "))

if number >= 0:

   print(number**0.5)

I hope this helps!

You might be interested in
Each wireless network has its own name to identify it, known as service set identity. true false
Dominik [7]
True. The acronym for service set identity is SSID, which you've likely saw before. And like you say, it's simply the unique name given to a wireless network so that we are able to identify what network we are connecting to.
8 0
2 years ago
In which of selye's stages in death a possible outcome?
kkurt [141]
D)Exhaustion
Hope this helps
6 0
3 years ago
Which of the items listed is not considered to be personal protective equipment (PPE)?
KatRina [158]

Answer:a

a t t i c

Explanation:

6 0
2 years ago
Write an algorithm that prints out all the subsets of 3 elements of a set of n elements. The elements of the set are stored in a
Ksenya-84 [330]

void Print_3_Element_Subsets(int n,const element_type S[])

{

if(n<3) // condition to check if list have less than 3 elements

{

print("No subset found");

}

for(int i =0; i < n ; i++)

{

for(int j =i+1; j < n ; j++)

{

for(int k =j+1; k < n ; k++)

{

print(S[i],S[j],S[k]);

}

}

}

}

C++ Implementation;

#include<cstdlib>

#include<time.h>

using namespace std;

int S1[5]= {1,2,3,4,5};

int n1 = 5;

int S2[2]={1,2};

int n2 = 2;

void Print_3_Element_Subsets(int n,const int S[])

{

if(n<3) // condition to check if list have less than 3 elements

{

printf("No subset found\n");

}

printf("3 Subsets are\n");

for(int i =0; i < n ; i++)

{

for(int j =i+1; j < n ; j++)

{

for(int k =j+1; k < n ; k++)

{

cout<<S[i]<<" "<<S[j]<<" "<<S[k]<<endl;

}

}

}

}

int main()

{

cout<<"Case 1"<<endl;

Print_3_Element_Subsets(n1,S1);

cout<<endl<<"Case 2"<<endl;

Print_3_Element_Subsets(n2,S2);

}

OUTPUT

Case 1

3 Subsets are

1 2 3

1 2 4

1 2 5

1 3 4

1 3 5

1 4 5

2 3 4

2 3 5

2 4 5

3 4 5

Case 2

No subset found

3 Subsets are

--------------------------------

Process exited after 0.0137 seconds with return value 0

Press any key to continue . . .

7 0
3 years ago
Given the lists list1 and list2, not necessarily of the same length, create a new list consisting of alternating elements of lis
tester [92]

Answer:

The following code is written in Python Programming Language.

Program:

list1=[1,2,3]

 # initialized the list type variable

list2=[4,5,6,7,8]

  # initialized the list type variable

list3=[]

   # initialized the empty list type variable

for j in range(max(len(list1), len(list2))):   #set for loop

 if j<len(list1):

  #set if statement

   list3.append(list1[j])

  #value of list1 appends in list3  

 if j<len(list2):

   #set if statement

   list3.append(list2[j])

  #value of list2 append in list3

print(list3)    #print the list of list3

Output:

[1, 4, 2, 5, 3, 6, 7, 8]

Explanation:

Here, we define three list type variables "list1", "list2", "list3" and we assign value in only first two variables "list1" to [1, 2, 3] and "list2" to [4, 5, 6, 7, 8] and third list is empty.

Then, we set the for loop and pass the condition inside it we pass two if conditions, in first one we compare the list1 from variable "j" inside it the value in list1 will append in list3, and in second one we compare "j" with list two and follow the same process.

After all, we print the list of the variable "list3".

5 0
2 years ago
Other questions:
  • To create an individual version of a slide, you would click
    9·1 answer
  • In three to five sentences, describe how good e-mail work habits increase workplace efficiency and productivity.
    12·1 answer
  • An idea concerning what will happen in the future. (Crossword)
    9·1 answer
  • How to reinstall windows 7 on my pc,without format,because i don't want to loose my data,and can u give me a windows 7 setup ple
    8·1 answer
  • Write the proghrams for the following:
    13·1 answer
  • Write a function swap that swaps the first and last elements of a list argument. Sample output with input: 'all,good,things,must
    10·2 answers
  • After fixing the format of her subheadings, she notices that she misspelled the name of one of the famous people
    7·2 answers
  • What is gained by increasing the ritation speed of a disk or cd?​
    9·1 answer
  • A student is browsing a website. While browsing, he click on a link that takes him to another website. Which code gives the corr
    14·1 answer
  • What will the "background-color" of the "topButton" be when the program is finished running?
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!