Questions: 5 290

Answers by our Experts: 5 288

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Search & Filtering

1. Each centroid in K- means algorithm defines one 

 

a.cluster

b.data point

c.two clusters

d.None of the above



1. Match the terms in Group A with the relevant terms in Group B

        Group A                     Group B

A.) k-means                  1) unsupervised learning algorithm

B) knn                       2) k is no. of clusters

c.) logistic regression          3) k is no. of neighbours

d). clustering                 4) logit function


Create a mini quiz game program that asks the user three (3) questions,the starting score is 10 points.if the answer is incorrect 1 point is deducted from the score


Write a Python program that will ask the user to input a string (containing exactly one word). Then your program should print subsequent substrings of the given string as shown in the examples below.


Write a Python program that will ask the user to enter a word as an input.

  • If the length of the input string is less than 4, then your program should print the same string as an output.
  • If the input string’s length is greater than 3, then your program should add "er" at the end of the input string.
  • If the input string already ends with "er", then add "est" instead, regardless of the length of the input string
  • If the input string already ends with "est", then your program should print the same input string as an output

Suppose you are given two strings, s1, and s2. Now, print a new string made up of the last characters and then the first characters of the input strings.



=====================================================================



Sample Input 1:



s1 = new



s2= string



Sample Output 1:



gwsn



Explanation: The last character of the String s2 is 'g'. The last character of the String s1 is 'w'. The first character of the String s2 is 's'. The first character of the String s1 is 'n'. Together they give us the ouput we want 'gwsn'.



=====================================================================



Sample Input 2:



s1 = abcd



s2= efgh



Sample Output 2:



hdea



Explanation: The last characters of the Strings s2 and s1 is 'h' and 'd' respectively while the first characters of the Strings is 'e' and 'a' respectively. Together they give us the ouput we want 'gwsn'

Number Guessing Game


In the number guessing game, the computer will randomly

select a number from a range of numbers e.g. 1-100 and then the game

will give the player five attempts to guess the number.


Gameplay:

If the player’s guess is higher than the chosen number, the

program will tell the player to try another LOWER than the

previous guess.


If the player’s guess is lower than the chosen number, the

program will tell the player to try another number HIGHER than

the previous guess.


If the player guesses the number before he consumes the five

attempts, then display congratulatory message.


I need the code to have an output stated above.


In the game Rock Paper Scissors, two players simultaneously choose one of the three options: rock, paper, scissors. If both player choose the same option, then the result is a tie. However, if they choose differently, the winner is determined as follows:


• Rock beats scissors, because a rock can break a pair of scissors

• Scissors beats paper, because scissors can cut paper

• Paper beats rock, because a piece of paper can cover a rock


Create a Python script in which a computer randomly choose

rock, paper or scissors. Let the user enter a number 1, 2, or 3 each

representing one of the three choices. Then, determine the winner.


I need the code to have an output stated above.


Create a Python script that will generate random n integers from a given start and end of a range.


I need the code to have an output stated below:


Value for n : 5

Value for start : 1

Value for end : 10

10 8 7 8 3


Write a for loop to print the numbers from 20 to 30, inclusive (this means it should include both the 20 and 30). The output should all be written out on the same line.



LATEST TUTORIALS
APPROVED BY CLIENTS