You are learning a new language, and are having a competition to see how many unique words you know in it to test your vocabulary learning.
Write a program where you can enter one word at a time, and be told how many unique words you have entered. You should not count duplicates. The program should stop asking for more words when you enter a blank line.
For example:
Word: Chat
Word: Chien
Word: Chat
Word: Escargot
Word:
You know 3 unique word(s)
Program:
# using set() to avoid duplication
words=set()
while(True):
word=input("Word: ")
if(word==""):
break;
words.add(word)
uniqueWords=str(len(words))
print("You know", uniqueWords,"unique word(s)")
Program Screenshot:
Output:
You are learning a new language, and are having a competition to see how many unique...
** Language Used : Python ** PART 2 : Create a list of unique words This part of the project involves creating a function that will manage a List of unique strings. The function is passed a string and a list as arguments. It passes a list back. The function to add a word to a List if word does not exist in the List. If the word does exist in the List, the function does nothing. Create a test...
Please write the code in assembly language which can run in
HLA. Thank you very much!!
-So
we need to write the code in assembly language in Notepad++, end
with .hla and run it in CMD.
- This project is about writing a program to read numbers,
counts the items read, calculates the total, the maximum and
minimum of the numbers.
-The program stops when a 0 is entered. Zero will not be part
of the data.
-work with integers,...
JAVA LANGUAGE
For this lab you are required to fulfill all requirements exactly as described in this provided document, no less, no more. Question: Today you are to write a Java program that will prompt for and read 2 words of equal length entered by the user, and create a new word which contains the last letter of the 1st word, the last letter of the 2nd word, followed by the second to last character of the 1st word, followed...
A competition takes place for the development of a new functionality that will be added on the NBA daily stats. This new functionality will show the player with the maximum ratio of points per minute. Develop a program in C++ that prompts the user to enter data for a number of NBA players and then outputs the player(s) with the maximum ratio of points per minute. You can store the players entered by the user in an array of structs...
How to play Bulls and Cows between you (the host) and your computer (the player) When completed, your program allows you to host the game (i.e., you create a secret word and score every guess) and it makes guesses until it wins. During the development or testing of your program, you may set a condition (e.g., the total count of guesses is already 10) to allow your program to request to reveal the secret word and quit the game. In...
I am having trouble figuring out what should go in the place of "number" to make the loop stop as soon as they enter the value they put in for the "count" input. I am also having trouble nesting a do while loop into the original while loop (if that is even what I am supposed to do to get the program to keep going if the user wants to enter more numbers???) I have inserted the question below, as...
Description: Overview: You will write a program (says wordcountfreq.c) to find out the number of words and how many times each word appears (i.e., the frequency) in multiple text files. Specifically, the program will first determine the number of files to be processed. Then, the program will createmultiple threads where each thread is responsible for one file to count the number of words appeared in the file and report the number of time each word appears in a global linked-list....
How can we add new words to DFA, maintaining minimality? Maybe, you can advise some completely different approach to solve the following problem: A program must process two types of queries: Add new word to the language. Check if some word of the language occurs in the input string as a substring. Time and space complexity should be as low as possible. The only solution that I know so far is to rebuild an automaton from scratch every time, using...
How many unique peaks would you expect to see in a
13C-NMR spectrum of molecule A, given
that each unique chemical environment should give rise to a unique
peak?
Molecule A Molecule B Molecule C HN Molecule D Molecule E Molecule F он Molecule G Molecule H Molecule I Molecule J Molecule K Molecule L HN Molecule M Molecule N Molecule o
CSC110
Lab 6 (ALL CODING IN JAVA)
Problem: A text file contains a paragraph. You are to read the
contents of the file, store the UNIQUEwords and count the
occurrences of each unique word. When the file is completely read,
write the words and the number of occurrences to a text file. The
output should be the words in ALPHABETICAL order along with the
number of times they occur and the number of syllables. Then write
the following statistics to...