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
Your program will read a word (or a whole line) from the user. It will then count the number of vowels in the word (or line) and
Softa [21]

Answer:

Following are the program in the Python Programming Language.

def vowel(): #define function

 print("Enter END to Break") #print message

 while(True): #set while loop

   word=input("Enter words: ") #get input from the user

   count=0 #set count to 0

   if(word=="END"): #set if condition

     break #terminate the loop

   else:

     for i in range(len(word)): #set the for loop

       c=word[i] #initialize in c

       if(c=='a'or c=='e' or c=='i'or c=='o'or c=='u'or c=='A'or c=='E'or c=='I'or c=='O'or c=='U'):

         count+=1 #increament in count by 1

     print("The word " , word , " contains " , count, end=" ")#print message

     if(count==1):#check condition

       print("vowel.")

     else:

       print("vowels")

#call the function

vowel()

Output:

Enter END to Break

Enter words: Vowel

The word  Vowel  contains  2 vowels

Enter words: END

Explanation:

Here, we define a function "vowel()" inside it.

  • Print message for the user.
  • Set the while loop and pass condition is True then, get input from the user in the variable "word" then, set variable "count" and initialize to 0.
  • Set if condition to check if the user input "END" then, the loop will terminate.
  • Otherwise, set for loop which continues from the length of the word.
  • Then, we set if statement which checks the vowel in the word, then increment in count by 1.
  • Print the message in the following format which is mentioned in the question.
  • Then, set if-else statement for check count is equal to 1 then print "vowel." Otherwise, it prints "vowels."

Finally, we call the following function "vowel()".

4 0
3 years ago
Describe a situation when you would use a conditional statement in a program. Describe the action that would occur when the cond
kramer

Answer:  Conditional statements are just true false statements

Explanation:

Let's say there's a kpop band burglarizing my house and I have a super AI that detects if a kpop band is my house through cameras. What it would do is change a variable "kpopBandInHouse = False" to True. I would then have an if statement next with a custom function:

if kpopBandInHouse == True:

   nukeHouse()

So if the conditional statement is true, it nukes my house. It is false, it does not nuke my house.

7 0
3 years ago
Robots can obtain data from the environment, store the data as knowledge, and modify their behavior
TiliK225 [7]
True robots that have integrated ML can store data in specialized arrays which can be processed by the algorithms to give the output as their behaviour.
5 0
4 years ago
What are the parts of word?
jolli1 [7]

Answer:

Explanation:

ASIA includes 50 countries, and it is the most populated continent, the 60% of the total population of the Earth live here.

AFRICA comprises 54 countries. It is the hottest continent and home of the world's largest desert, the Sahara, occupying the 25% of the total area of Africa.

NORTH AMERICA includes 23 countries led by the USA as the largest economy in the world.

SOUTH AMERICA comprises 12 countries. Here is located the largest forest, the Amazon rainforest, which covers 30% of the South America total area.

ANTARCTICA is the coldest continent in the world, completely covered with ice. There are no permanent inhabitants, except of scientists maintaining research stations in Antarctica.

EUROPE comprises 51 countries. It is the most developed economically continent with the European Union as the biggest economic and political union in the world.

AUSTRALIA includes 14 countries. It is the least populated continent after Antarctica, only 0.2% of the total Earth population live here.

7 0
3 years ago
Scrabble is a word game in which words are constructed from letter tiles, each letter tile containing a point value. The value o
Fantom [35]

Complete question:

Scrabble is a word game in which words are constructed from letter tiles, each letter tile containing a point value. The value of a word is the sum of each tile's points added to any points provided by the word's placement on the game board. Write a program using the given dictionary of letters and point values that takes a word as input and outputs the base total value of the word (before being put onto a board). Ex:  If the input is:  PYTHON

the output is: 14

part of the code:

tile_dict = { 'A': 1, 'B': 3, 'C': 3, 'D': 2, 'E': 1, 'F': 4, 'G': 2, 'H': 4, 'I': 1, 'J': 8,  'K': 5, 'L': 1, 'M': 3, 'N': 1, 'O': 1, 'P': 3, 'Q': 10, 'R': 1, 'S': 1, 'T': 1,  'U': 1, 'V': 4, 'W': 4, 'X': 8, 'Y': 4, 'Z': 10 }

Answer:

Complete the program as thus:

word = input("Word: ").upper()

points = 0

for i in range(len(word)):

   for key, value in tile_dict.items():

       if key == word[i]:

           points+=value

           break

print("Points: "+str(points))

Explanation:

This gets input from the user in capital letters

word = input("Word: ").upper()

This initializes the number of points to 0

points = 0

This iterates through the letters of the input word

for i in range(len(word)):

For every letter, this iterates through the dictionary

   for key, value in tile_dict.items():

This locates each letters

       if key == word[i]:

This adds the point

           points+=value

The inner loop is exited

           break

This prints the total points

print("Points: "+str(points))

6 0
3 years ago
Other questions:
  • Is it save too say that any job you apply for or are eligible for has to have some type of technology?
    6·2 answers
  • Of the following choices, what indicates the primary purpose of an intrusion detection system (IDS)?
    12·1 answer
  • What is the relevance of Address Block?​
    13·1 answer
  • Python1. Assume that name is a variable of type String that has been assigned a value. Write an expression whose value is a Stri
    12·1 answer
  • Create a script to input 2 numbers from the user. The script will then ask the user to perform a numerical calculation of additi
    7·1 answer
  • What is Accenture's role in Multi-party Systems?
    12·1 answer
  • 1. Define the term Intranet.
    10·1 answer
  • True/False: Functions are ideal for use in menu-drive programs. When a user selects a menu item, the program can call an appropr
    13·1 answer
  • if a user watches a video with event tracking three times in a single session, analytics will count how many unique events?
    11·1 answer
  • Which of the following tiny computer apps is designed to be useful but could cause more harm than good?
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!