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
SOVA2 [1]
4 years ago
14

1i) Standardize 'weight' column Write a function named standardize_weight that takes in as input a string and returns an integer

. The function will do the following (in the order specified): 1) convert all characters of the string into lowercase 2) strip the string of all leading and trailing whitespace 3) replace any occurences of 'lbs' with '' (remove it from the string) 4) replace any occurences of 'lb' with '' (remove it from the string)
Computers and Technology
1 answer:
jeka57 [31]4 years ago
4 0

Answer:

import numpy as np

def standardize_weight(inp):

#1

inp=inp.lower()

print(inp)

#2

inp=inp.strip()

print(inp)

#3

inp=inp.replace("lbs"," ")

print(inp)

#4

inp=inp.replace("lb"," ")

print(inp)

#5

inp=inp.replace("pounds"," ")

print(inp)

 

print(inp.find("kg"))

#6

if(inp.find("kg")>=0):

inp=inp.replace("kg"," ")

print(inp)

inp_int=int(inp)

print(inp_int*2)

inp=str(inp_int)

print(inp)

#7

inp=inp.strip()

print(inp)

#8

if(inp.isdigit()):

inp=int(inp)

#9

else:

inp=np.nan

 

res=standardize_weight(" List albkg repLacleg sublkg " )

Explanation:

You might be interested in
How many solutions exist for the given equation?
vovikov84 [41]
Infinity amount of answers because each side can be simplified to x making any solution correct
6 0
3 years ago
Most shops require the technician to enter a starting and ending time on the repair order to track the actual time the vehicle w
Alecsey [184]

The time being referred to is C. cycle time. Cycle time refers to the amount of time from start to end of a process as agreed and defined by a service provider (in this case, the technician) and the customer. Cycle time can also be lengthened or shortened.

5 0
4 years ago
Read 2 more answers
A user states that when they power on their computer, they receive a "Non-bootable drive" error. The user works with external st
laila [671]

Answer:

B. Device boot order

Explanation:

The Device boot order makes a list of all the possible devices a system should check to in the operating system's boot files, as well as the proper sequence they should be in. Removable devices, hard drives, and flash drives are some devices that can be listed in the device boot order.

For the user whose computer displays a 'non-bootable drive' error, the device boot order would check all the devices listed to attempt booting from any of them. These devices might be in the order of removable discs, CD-ROM, hard drive. If all the options do not work, the computer would then do a Network boot. The order in which the devices are listed can be altered by the user.

8 0
4 years ago
Explain 2 ways in which data can be protected in a home computer??
Nonamiya [84]

Answer:

The cloud provides a viable backup option. ...

Anti-malware protection is a must. ...

Make your old computers' hard drives unreadable. ...

Install operating system updates. ...

3 0
3 years ago
A user has become compromised as a result of visiting a specific web page, without clicking on any kind of content. What type of
Nostrana [21]

Answer:

drive-by-download

Explanation:

3 0
3 years ago
Read 2 more answers
Other questions:
  • Explain how do we combine multiple Boolean values?​
    5·1 answer
  • How to create a function, called separate_int_and_str, which takes in a list and separates out the integer values and strings in
    9·1 answer
  • Students who respond promptly to e-mails are following which netiquette rule?
    13·2 answers
  • What does "scanf(\"%d\" mean?
    13·2 answers
  • What is a command-line interactive scripting environment that provides the commands for almost any management task in a Windows
    9·1 answer
  • PLEASEEEEEE HELP, ILL DO ANYTHING JUST ANSWER THESE CORRECTLY!!!!!TYSM!!!
    15·2 answers
  • Can someone answer this, I'll mark u the brialintest
    11·1 answer
  • Functions of light pen​
    9·1 answer
  • This might be a bad question but what is an AMD Radeon 380 series equivalent to
    7·1 answer
  • Check image dont answer if you dont know please
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!