Questions: 5 831

Answers by our Experts: 5 728

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

neutralisation question input should be +------+--- --+-+-++-- and output should be 0-0-0-++0-


Make it equal python program answer



In a Primary school N students are lined up in arow

String matching



Input 1



3


Hello Hell*


Hell He*ll


Hell hell*


Output 1


True


True


False



Input 2


3


Hello *l?


Hell He? ll


Hell ? *



Output 2


True


False


True




Input 1


2315313134 5234423114


Output 1


hello world


Input 2


112234


Output 2


ago

Download the text file Activity10.txt (linked here) and save it in the same directory where you save the source code for this activity. Write a Python program that reads the Activity10.txt file’s contents and determines the following:

  • The number of uppercase letters in the file
  • The number of lowercase letters in the file
  • The number of digits in the file
  • The number of whitespace characters in the file

Use the string functions isupper()islower()isdigit()isspace() introduced in Section 8.3.





Reducing Fraction to Lowest Term


Create a Python script that will reduce an input fraction to its lowest term.


Program Requirements:


1. Define a function that will check first if the input fraction is a VALID fraction.


2. Define a function that will split a VALID fraction and return a list that consists the numerator and denominator.


3. Define a function that will accept two parameters (numerator and denominator to determine the greatest common divisor.


4. Define a function that will accept two parameters (numerator, denominator) and will return the reduced fraction.


Sample Output:


Input a fraction?: 5/0


Invalid fraction

Kaye Keith C. Ruden


Machine Problem 3


Reducing Fraction to Lowest Term


Create a Python script that will reduce an input fraction to its lowest term.


Program Requirements:


1. Define a function that will check first if the input fraction is a VALID fraction.


2. Define a function that will split a VALID fraction and return a list that consists the numerator and denominator.


3. Define a function that will accept two parameters (numerator and denominator to determine the greatest common divisor.


4. Define a function that will accept two parameters (numerator, denominator) and will return the reduced fraction.


Sample Output:


Input a fraction?: 5/0


Invalid fraction

Create a class in Python called Sorting which takes in a file name as an argument. An object of class Sorting will have methods called:

  •  Create a method called GetData which reads in the numbers found in the file and stores them in a list or array.
  •  Create a method called SortData which sorts the data collected by the GetData method in ascending order.

Hint: Use BubbleSort and take in the array or list from the GetData method as an argument.

  • Create a method called ReverseData which sorts the data contained in the file in descending order.

 Hint: You can use any method of reversing a list or array for this requirement. This can be done using slicing, by using the build in reversed() method, or by importing/using modules like array and NumPy. Keep in mind the last two methods require pip installs!

  •  Create a function called main which creates an object of class Sorting and calls the GetData, SortData, and ReverseData methods. Use __main__ to automatically call this main method at runtime.

Reducing Fraction to Lowest Term


Create a Python script that will reduce an input fraction to its lowest term.


4. Define a function that will accept two parameters (numerator, denominator) and will return the reduced fraction.


Sample Output 1:


Input a fraction: 4/6


Reduced fraction is 2/3

Reducing Fraction to Lowest Term


Create a Python script that will reduce an input fraction to its lowest term.


3. Define a function that will accept two parameters (numerator and denominator to determine the greatest common divisor.


Sample Output 1:


Input a fraction: 4/6


Reduced fraction is 2/3

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS