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
Delvig [45]
3 years ago
8

Please help and answerr

Computers and Technology
1 answer:
Oxana [17]3 years ago
5 0
Renamin file, storing data, loading a file from disk drive
You might be interested in
Start with the following Python code. alphabet = "abcdefghijklmnopqrstuvwxyz" test_dups = ["zzz","dog","bookkeeper","subdermatog
trapecia [35]

Answer:

alphabet = "abcdefghijklmnopqrstuvwxyz"

test_dups = ["zzz","dog","bookkeeper","subdermatoglyphic","subdermatoglyphics"]

test_miss = ["zzz","subdermatoglyphic","the quick brown fox jumps over the lazy dog"]

# From Section 11.2 of: # Downey, A. (2015). Think Python: How to think like a computer scientist. Needham, Massachusetts: Green Tree Press.

def histogram(s):

   d = dict()

   for c in s:

       if c not in d:

           d[c] = 1

       else:

           d[c] += 1

   return d

#Part 1 Write a function called has_duplicates that takes a string parameter and returns True if the string has any repeated characters. Otherwise, it should return False.

def has_duplicates(stringP):

   dic = histogram(stringP)

   for key,value in dic.items():

       if value>1:

           return True

   return False

# Implement has_duplicates by creating a histogram using the histogram function above. Write a loop over the strings in the provided test_dups list.

# Print each string in the list and whether or not it has any duplicates based on the return value of has_duplicates for that string.

# For example, the output for "aaa" and "abc" would be the following. aaa has duplicates abc has no duplicates Print a line like one of the above for each of the strings in test_dups.

print("***Implementation of has_duplicates fuction***")

for sTr in test_dups:

   if has_duplicates(sTr):

       print(sTr+": has duplicates")

   else:

       print(sTr+": has no duplicates")

#Part 2 Write a function called missing_letters that takes a string parameter and returns a new string with all the letters of the alphabet that are not in the argument string.

#The letters in the returned string should be in alphabetical order. Your implementation should use a histogram from the histogram function. It should also use the global variable alphabet.

#It should use this global variable directly, not through an argument or a local copy. It should loop over the letters in alphabet to determine which are missing from the input parameter.

#The function missing_letters should combine the list of missing letters into a string and return that string.

def missing_letters(sTr):

   missingLettersList = []

   dic = histogram(sTr)

   for l in alphabet:

       if l not in dic:

           missingLettersList.append(l)

   missingLettersList.sort()

   return "".join(missingLettersList)

#Write a loop over the strings in list test_miss and call missing_letters with each string. Print a line for each string listing the missing letters.

#For example, for the string "aaa", the output should be the following. aaa is missing letters bcdefghijklmnopqrstuvwxyz

#If the string has all the letters in alphabet, the output should say it uses all the letters.

#For example, the output for the string alphabet itself would be the following. abcdefghijklmnopqrstuvwxyz uses all the letters

#Print a line like one of the above for each of the strings in test_miss.

print("\n***Implementation of missing_letters fuction***")

for lTm in test_miss:

   sTr = missing_letters(lTm.replace(" ",""))

   if sTr!="":

       print(lTm+" is missing letters "+sTr)

   else:

       print(lTm +" uses all the letters")

3 0
3 years ago
What is the advantage of defining a target user?
spayn [35]
3) helps the designer develop a website tailored to the desired audience
4 0
3 years ago
COMPUTER SCIENCE:PIXELS
DIA [1.3K]
The number of bits used to represent each pixel determines how many colors or shades of grey can be displayed. For example, in 8-bit color mode the color monitor uses 8 bits for each pixel, making it possible to display 2 to the 8th power (256) colors/shades of grey.
3 0
3 years ago
Why is the cpu the most important component in a computer?
german
CPU (Central Processing Unit) is also known as the brain of the computer because this is the place which actually runs the programs. The programs are the set of instructions needed to perform a task.
4 0
3 years ago
Many people in modern society have the notion that hard disks can be searched in an hour and files can be recovered from inciner
atroni [7]

Answer:

The CSI effect.

Explanation:

  • The process of recovering the file or the directory from the hard disks that are  burned by teaming them up to a computer is known as the CSI effect in the hard disk.
  • This term is given by the expertise in the organization and it is used in the modern  society  .The CSI is used for only the hard disk in the computer system.
5 0
4 years ago
Other questions:
  • While engineers work to create computers that can understand us emotionally, ________ are also evolving toward a more human appe
    12·1 answer
  • What type of software translates a programmer’s statements to binary form?
    10·1 answer
  • What is the relationship between IaaS and TCP/IP and network services?
    10·2 answers
  • A user prefers an external monitor, mouse, and keyboard for a laptop. The user does not want to use the built-in screen; however
    5·1 answer
  • Animation includes special visual and sound effects applied to text or other content. true or false.
    14·1 answer
  • What kind of software program delivers advertising content in a manner that is unexpected and unwanted by the user, and is typic
    14·1 answer
  • The term used to describe the shape and layout of a computer component such as a motherboard or hard drive is ______ factor.
    5·1 answer
  • Select the correct answer
    5·2 answers
  • The cost of an items is Rs 200. what will be the cost of 50 such items. write a simple program​
    10·1 answer
  • TASK 1. JUMBLE ME! Direction: Arrange the jumbled letters to form a word. 1. PEREAM 2. RRENT CU 3. METREMO H 4. TORSISER 5. TANC
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!