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
Vadim26 [7]
3 years ago
6

Write a function named is_float(s) that takes one argument that is a string. It returns True if string s represents a floating p

oint value and returns False otherwise. You are required to use try-except. The basic concept is to "try" to convert string s to a float and if it succeeds, return True, but if it fails (that is, an exception is raised), return False. Note that float() raises a ValueError exception.
Engineering
1 answer:
Vedmedyk [2.9K]3 years ago
8 0

Answer:

Explanation:

# Python Programme

#!/usr/bin/python

# Function definition is here

def is_float( str ):

try:

float(str)

return True

except ValueError:

return False

# Now you can call is_float function

print(is_float("3.45"))

print(is_float("3e4"))

print(is_float("abc"))

print(is_float("4"))

print(is_float(".5"))

You might be interested in
It is desired to produce and aligned carbon fiber-epoxy matrix composite having a longitudinal tensile strength of 630 MPa. Calc
ratelena [41]

Answer:

The answer is below

Explanation:

Given that:

Diameter (D) = 0.03 mm = 0.00003 m, length (L) = 2.4 mm = 0.0024 m, longitudinal tensile strength (\sigma_{cd})=630\ MPa = 630*10^6\ Pa, Fracture strength

(\sigma_f)=5100\ MPa=5100*10^6\ Pa,fiber-matrix\ stres(\sigma_m)=17.5\ MPa=17.5*10^6\ Pa,matrix\ strength=\tau_c=17\ MPa=17 *10^6\ Pa

a) The critical length (L_c) is given by:

L_c=\sigma_f*(\frac{D}{2*\tau_c} )=5100*10^6*\frac{0.00003}{2*17*10^6}=0.0045\ m=4.5\ mm

The critical length (4.5 mm) is greater than the given length, hence th composite can be produced.

b) The volume fraction (Vf) is gotten from the formula:

\sigma_{cd}=\frac{L*\tau_c}{D}*V_f+\sigma_m(1-V_f)\\\\V_f=\frac{\sigma_{cd}-\sigma_{m}}{\frac{L*\tau_c}{D}-\sigma_{m}}  \\\\Substituting:\\\\V_f=\frac{630*10^6-17.5*10^6}{\frac{0.0024*17*10^6}{0.00003} -17.5*10^6} \\\\V_f=0.456

6 0
3 years ago
Type the correct answer in the box. Spell all words correctly. Mike is constructing a project in which he uses a motor. How can
tankabanditka [31]
If it is. DC, direct current reverse the polarity of power leads on the motor.

If it is a 3 phase ac alternating current, reverse any of the two of three leads.

Disconnect power before attempting.
6 0
3 years ago
On aircraft equipped with fuel pumps, when is the auxiliary electric driven pump used?.
pochemuha
In an airplane equipped with fuel pumps, the auxiliary electric fuel pump is used in the event the engine-driven fuel pump fails.. hope this helped !
6 0
2 years ago
A one-dimensional plane wall of thickness 2L=80 mm experiences uniform thermal generation of q= 1000 W/m^3 and is convectively c
Eduardwww [97]

Answer:

h=1.99998\ W/m^2.C

k=33.333\ W/m.C

Explanation:

Considering the one dimensional and steady state:

From Heat Conduction equation considering the above assumption:

\frac{\partial^2T}{\partial x^2}+\frac{\dot e_{gen}}{k}=0       Eq (1)

Where:

k is thermal Conductivity

\dot e_{gen} is uniform thermal generation

T(x) = a(L^2-x^2)+b

\frac{\partial\ T(x)}{\partial x}=\frac{\partial\ a(L^2-x^2)+b}{\partial x}=-2ax\\\frac{\partial^2\ T(x)}{\partial x^2}=\frac{\partial^2\ -2ax}{\partial x^2}=-2a

Putt in Eq (1):

-2a+\frac{\dot e_{gen}}{k}=0\\ k=\frac{\dot e_{gen}}{2a}\\ k=\frac{1000}{2*15}\\ k=33.333\ W/m.C

Energy balance is given by:

Q_{convection}=Q_{conduction}

h(T_L-T_{inf})=-k(\frac{dT}{dx}) _L     Eq  (2)

T(x) = a(L^2-x^2)+b

Putting x=L

T(L) = a(L^2-L^2)+b\\T(L)=b\\T(L)=40^oC

\frac{dT}{dx}=\frac{d(a(L^2-x^2)+b}{dx}=-2ax\\Put\ x\ =\ L\\\frac{dT}{dx}=-2aL\\(\frac{dT}{dx})_L=-2*15*0.04=-1.2

From Eq (2)

h=\frac{-k*-1.2}{(40-20)} \\h=\frac{-33.333*-1.2}{(40-20)}\\h=1.99998\ W/m^2.C

7 0
3 years ago
What do you think of this schematic diagram?​
Sholpan [36]

Explanation:

A schematic diagram is a picture that represents the components of a process, device, or other object using abstract, often standardized symbols and lines. ... Schematic diagrams do not include details that are not necessary for comprehending the information that the diagram was intended to convey.

5 0
3 years ago
Other questions:
  • Which phrase best describes a safety-critical system? A. a system that faces a very high risk of failure B. a system isolated fr
    13·1 answer
  • A PMOS device with VT P = −1.2 V has a drain current iD = 0.5 mA when vSG = 3 V and vSD = 5 V. Calculate the drain current when:
    12·1 answer
  • A stem and leaf display
    12·1 answer
  • 10–25. The 45° strain rosette is mounted on the surface of a shell. The following readings are obtained for each gage: ε a = −20
    9·1 answer
  • Steam enters an adiabatic condenser (heat exchanger) at a mass flow rate of 5.55 kg/s where it condensed to saturated liquid wat
    11·1 answer
  • Consider that a system has two entities, Students, Instructors and Course. The Student has the following properties: student nam
    12·1 answer
  • A 2.0-in-thick slab is 10.0 in wide and 12.0 ft long. Thickness is to be reduced in three steps in a hot rolling operation. Each
    9·1 answer
  • Let be a real-valued signal for which when . Amplitude modulation is preformed to produce the signal . A proposed demodulation t
    9·1 answer
  • Engineering problems and it solutions it machine design​
    5·1 answer
  • Find the altitude of the right cylinder of maximum convex surface that can be inscribed in a given sphere.
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!