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
natali 33 [55]
2 years ago
11

Code a program that gets all possible solutions of a string using 3 for loops. Actual question attached

Computers and Technology
1 answer:
Nikitich [7]2 years ago
8 0

\tt x=int(input("Enter\:first\:no:"))

\tt y=int(input("Enter\:second\:no:"))

\tt z=int(input("Enter\:third\:no:"))

\tt for\:x\:in\: range (3):

\quad\tt for\:y\:in\:range(3):

\quad\quad\tt for\:z\:in\:range(3):

\quad\quad\quad\tt if\:x!=y\:and\:y!=z\:and\:z!=x:

\quad\quad\quad\quad\tt print(x,y,z)

You might be interested in
A team member who does not feel comfortable disagreeing with someones opinion in front of the team would most likely come from a
Sedbober [7]

Answer:

discussions and decisions made about public policy

Explanation:

7 0
2 years ago
1. Implement the function dict_intersect, which takes two dictionaries as parameters d1 and d2, and returns a new dictionary whi
stich3 [128]

Answer:

1  

def dict_intersect(d1,d2): #create dictionary

  d3={} #dictionaries

  for key1,value1 in d1.items():       #iterate through the loop  

      if key1 in d2:   #checking condition

          d3[key1]=(d1[key1],d2[key1])   #add the items into the dictionary  

  return d 3

print(dict_intersect({'a': 'apple', 'b': 'banana'}, {'b': 'bee', 'c': 'cat'})) #display

2

def consolidate(*l1):  #create consolidate

  d3={} # create dictionary

  for k in l1:       #iterate through the loop

      for number in k:   #iterate through  the loop                               d3[number]=d3.get(number,0)+1   #increment the value

             return d 3 #return

print(consolidate([1,2,3], [1,1,1], [2,4], [1])) #display

Explanation:

1

Following are  the description of program

  • Create a dictionary i.e"dict_intersect(d1,d2) "   in this dictionary created a dictionary d3 .
  • After that iterated the loop and check the condition .
  • If the condition is true then add the items into the dictionary and return the dictionary d3 .
  • Finally print them that are specified in the given question .

2

Following are  the description of program

  • Create a dictionary  consolidate inside that created a dictionary "d3" .
  • After that iterated the loop outer as well as inner loop and increment the value of items .
  • Return the d3 dictionary and print the dictionary as specified in the given question .

5 0
4 years ago
How is a Creative Commons license different from a regular copyright?
gayaneshka [121]

Answer:

Creative Commons is actually a license that is applied to a work that is protected by copyright. It's not separate from copyright, but instead is a way of easily sharing copyrighted work. ... Copyright confers some pretty heavy duty protections so that others don't use your work without your permission.

Explanation:

8 0
3 years ago
Choose the proper term to describe each of the following examples.
Lady_Fox [76]

Answer:first 1

Explanation:

4 0
3 years ago
-Write a function is_perfect, which accepts a single integer as input. If the input is not positive, the function should return
Genrish500 [490]

Answer:

// here is code in C++.

#include <bits/stdc++.h>

using namespace std;

// function

string is_perfect(int n)

{

   // string variables

   string str;

   // if number is negative

   if (n < 0)

   {

        str="invalid input.";

   }

   // if number is positive

   else

   {

      int a=sqrt(n);

      // if number is perfect square

      if((a*a)==n)

      {

          str="True";

      }

      // if number is not perfect square

      else

      {

          str="False";

      }

   }

   // return the string

     return str;

}

// main function

int main()

{

   // variables

int n;

cout<<"enter the number:";

// read the value of n

cin>>n;

// call the function

string value=is_perfect(n);

// print the result

cout<<value<<endl;

return 0;

}

Explanation:

Read a number from user and assign it to variable "n".Then call the function is_perfect() with parameter n.First check whether number is negative or not. If number is negative then return a string "invalid input".If number is positive and perfect square then return a string "True" else return a string "False".

Output:

enter the number:-3

invalid input.

enter the number:5

False

enter the number:16

True

4 0
3 years ago
Other questions:
  • How to divert all calls and sms from one mobile phone to other mobile phone, any short code??
    10·1 answer
  • EDI decreases ______
    15·1 answer
  • Which of the following statements is correct? Group of answer choices An object of type Employee can call the setProjectName met
    11·1 answer
  • Disadvantages of Batch<br>operation system​
    5·1 answer
  • You have a friend that says she is interested in going into web development. She is very knowledgeable in terms of technology an
    13·1 answer
  • which statement describe “Hackers”? | A. all have the same motive | B. break into other people’s computers | C. may legally brea
    14·1 answer
  • Does any body know how to bypass easy anti cheat on crossout
    7·1 answer
  • Write a program that accepts a whole number as
    5·1 answer
  • If the cpu is fast but the bus speed is slow, that condition is called?
    15·1 answer
  • Data mining requires specialized data analysts to ask ad hoc questions and obtain answers quickly from the system. select one: t
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!