Python makes the work a lot easier.
Code:
#taking input from the user
my_input = input("Enter the string:")
# converting the string to upper case so that
# the string is non case-sensitive'''
my_input = my_input.upper()
#seperating the words in a list
words_list = my_input.split()
#convert the list to set
#as set contains only unique elements
myset = set(words_list)
#Display no. of unique words
print ("There are" , len(myset), "unique words in the string.")
Screenshots:

Hope you like the answer.
Please give it a like and your valuable feedback or any doubt.
python code for this question hackerrank.com/test/Omlrph6/questions/b449fdk16 shoot 100% D D M Inbox (115 - er Welcome...
Question / of 2. Case insensitive string compare: [40 marks/ Write a function that compares two strings while ignoring the case of alphabetical characters. Your program will take two strings as input from the user and use your function to compare them. Assume a maximum C-string size of 1000 characters. Make sure your code works for any input number, not just the test cases. Your code will be tested on other test cases not listed here. Please properly comment your...
hey please answer in python 3
This is the test for these questions. it has to be exactly the
same as the Expected output.
notice my code is very close to getting it but im always
off by 0.01 or 0.02.
Thank you for the help!
In this exercise, you will build a program to process files containing paragraphs. The aim of the program is to simply count the number of words and compute their length. The file, however, may...
I need help with this code,
I'm stuck on it, please remember step 4, I'm very much stuck on
that part. It says something about putting how many times it
appears
Assignment #1: Sorting with Binary Search Tree Through this programming assignment, the students will learn to do the following: Know how to process command line arguments. 1 Perform basic file I/O. 2. Use structs, pointers, and strings. Use dynamic memory. 3. 4. This assignment asks you to sort the...
In python please. Write a program that reads whitespace delimited strings (words) and an integer (freq). Then, the program outputs the strings from words that have a frequency equal to freq in a case insensitive manner. Your specific task is to write a function wordsOfFreqency(words, freq), which will return a list of strings (in the order in which they appear in the original list) that have a frequency same as the function parameter freq. The parameter words to the function...
For all problems you must: Write a Python (.py) program Test, debug, and execute the Python program Submit a copy of your commented source code on-line (11 pts.) Create a Person class that contains the following members: name, email, and phone_number Provide a constuctor that initializes all three members with data passed to the constructor. Add a __str__ method that returns a string printing the data members. Provide methods that allows you to get and set all three data members....
Write the code in python programming Language String Statistics: Write a program that reads a string from the user and displays the following information about the string: (a) the length of the string, (b) a histogram detailing the number of occurrences of each vowel in the string (details provided below), (c) the number of times the first character of the string occurs throughout the entire string, (d) the number of times the last character of the string occurs throughout the...
** 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...
In this lab you will implement tickets-for-seat-management system. The basic idea is that your program reads an event number and seat number request from a user, and determines if the seat is available (and marks it taken if it was), or is unavailable (so asking the user to choose again). As part of that exercise, you’ll be working with a file of “canned” requests to exercise your program. That is, instead of typing the requests in to your program, the...
Intro to Programming and Logic: Python 2, Chapter 8 – Strings (so far have learned the way of a program, variables, expressions, statements, functions, interface design, conditional, recursion and iteration) Write a program that takes a string as a parameter. It will analyze the string and return True if it is a valid float number. It will return False if it is not a valid float value. Your function should return True in any of these cases: 0.17, .17, 5.27,...
Question 2 Use a switch statement to write the following program: Using C++ The program prompts the user for a letter grade (of type char). The list of valid letter grades is: A B C D E F The program should consider both lower and upper case The program will then display the following messages: For grade ‘A’: display “Excellent” For grade ‘B’: display “Good” For Grade ‘C’: display “Average” For grade ‘D’ or ‘E’: display “Below Average” For Grade...