answer.
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]
2 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]2 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
The velocity distribution for laminar flow between parallel plates is given by u umax = 1 − ( 2y h ) 2 Where h is the distance s
Lynna [10]

Answer:

Explanation:

For we to calculate the shear stress on the upper plate and give its direction. Sketch the variation of shear stress across the channel, I used hand in solving it, check attached file below

5 0
2 years ago
A steady tensile load of 5.00kN is applied to a square bar, 12mm on a side and having a length of 1.65m. compute the stress in t
Shtirlitz [24]

Answer:

The stress in the bar is 34.72 MPa.

The design factor (DF) for each case is:

A) DF=0.17

B) DF=0.09

C) DF=0.125

D) DF=0.12

E) DF=0.039

F) DF=1.26

G) DF=5.5

Explanation:

The design factor is the relation between design stress and failure stress. In the case of ductile materials like metals, the failure stress considered is the yield stress. In the case of plastics or ceramics, the failure stress considered is the breaking stress (ultimate stress). If the design factor is less than 1, the structure or bar will endure the applied stress. By the opposite side, when the DF is higher than 1, the structure will collapse or the bar will break.

we will calculate the design stress in this case:

\displaystyle \sigma_{dis}=\frac{T_l}{Sup}=\frac{5.00KN}{(12\cdot10^{-3}m)^2}=34.72MPa

The design factor for metals is:

DF=\displaystyle \frac{\sigma_{dis}}{\sigma_{f}}=\frac{\sigma_{dis}}{\sigma_{y}}

The design factor for plastic and ceramics is:

DF=\displaystyle \frac{\sigma_{dis}}{\sigma_{f}}=\frac{\sigma_{dis}}{\sigma_{u}}

We now need to know the yield stress or the ultimate stress for each material. We use the AISI and ASTM charts for steels, materials charts for non-ferrous materials and plastics safety charts for the plastic materials.

For these cases:

A) The yield stress of AISI 120 hot-rolled steel (actually is AISI 1020) is 205 MPa, therefore:

DF=\displaystyle\frac{34.72MPa}{205MPa}=0.17

B) The yield stress of AISI 8650 OQT 1000 steel is 385 MPa, therefore:

DF=\displaystyle\frac{34.72MPa}{385MPa}=0.09

C) The yield stress of ductile iron A536-84 (60-40-18) is 40Kpsi, this is 275.8 MPa, therefore:

DF=\displaystyle\frac{34.72MPa}{275.8MPa}=0.125

D) The yield stress of aluminum allot 6061-T6 is 290 MPa, therefore:

DF=\displaystyle\frac{34.72MPa}{290MPa}=0.12

E) The yield stress of titanium alloy Ti-6Al-4V annealed (certified by manufacturers) is 880 MPa, therefore:

DF=\displaystyle\frac{34.72MPa}{880MPa}=0.039

F) The ultimate stress of rigid PVC plastic (certified by PVC Pipe Association) is 4Kpsi or 27.58 MPa, therefore:

DF=\displaystyle\frac{34.72MPa}{27.58 MPa}=1.26

In this case, the bar will break.

F) You have to consider that phenolic plastics are used as matrix in composite materials and seldom are used alone with no reinforcement. In this question is not explained if this material is reinforced or not, therefore I will use the ultimate stress of most pure phenolic plastics, in this case, 6.31 MPa:

DF=\displaystyle\frac{34.72MPa}{6.31 MPa}=5.5

This material will break.

3 0
2 years ago
A curve in a speed track has a radius of 1000 ft and a rated speed of 120 mi/h. (From Sample Prob. 12.7 is the definition of rat
forsale [732]

Answer:

tan \theta = \frac{(176ft/s)^2}{1000 ft 32.2 ft/s^2}= 0.962

\theta = tan^{-1} (0.962) = 43.89

Explanation:

If the question is: Determine the banking angle θ

We have the forces involved on the figure attached.

For this case we know that the weight is given by:

W = mg

And for this case the centripetal acceleration would be given by:

a=\frac{v^2}{r}

If we analyze the sum of forces on x and y we have:

\sum F_x = m a_x

F + W sin \theta = ma cos theta

And if we solve for the force we got:

F = ma cos \theta - mg sin \theta = \frac{mv^2}{r} cos \theta - mg sin \theta

\sum F_y = m a_y

N - W cos \theta = ma sin \theta

If we solve for the normal force we got:

N =W cos \theta + ma sin \theta = \frac{mv^2}{r} sin \theta + mg cos \theta

In order to find the banking angle we use the fact that F =0

0 = \frac{mv^2}{r} cos \theta - mg sin \theta

tan \theta= \frac{v^2}{rg}

The velocity on this case is 120 mi/h if we convert this into ft/ s we got:

120 mi/h * \frac{5280 ft}{1mi} *\frac{1hr}{3600 s}= 176 ft/s

And then we have this:

tan \theta = \frac{(176ft/s)^2}{1000 ft 32.2 ft/s^2}= 0.962

\theta = tan^{-1} (0.962) = 43.89

5 0
2 years ago
Determine the angular acceleration of the uniform disk if (a) the rotational inertia of the disk is ignored and (b) the inertia
lukranit [14]

Answer:

α = 7.848 rad/s^2  ... Without disk inertia

α = 6.278 rad/s^2  .... With disk inertia

Explanation:

Given:-

- The mass of the disk, M = 5 kg

- The right hanging mass, mb = 4 kg

- The left hanging mass, ma = 6 kg

- The radius of the disk, r = 0.25 m

Find:-

Determine the angular acceleration of the uniform disk without and with considering the inertia of disk

Solution:-

- Assuming the inertia of the disk is negligible. The two masses ( A & B )  are hung over the disk in a pulley system. The disk is supported by a fixed support with hinge at the center of the disk.

- We will make a Free body diagram for each end of the rope/string ties to the masses A and B.

- The tension in the left and right string is considered to be ( T ).

- Apply newton's second law of motion for mass A and mass B.

                      ma*g - T = ma*a

                      T - mb*g = mb*a

Where,

* The tangential linear acceleration ( a ) with which the system of two masses assumed to be particles move with combined constant acceleration.

- g: The gravitational acceleration constant = 9.81 m/s^2

- Sum the two equations for both masses A and B:

                      g* ( ma - mb ) = ( ma + mb )*a

                      a =  g* ( ma - mb ) / ( ma + mb )

                      a = 9.81* ( 6 - 4 ) / ( 6 + 4 ) = 9.81 * ( 2 / 10 )

                      a = 1.962 m/s^2  

- The rope/string moves with linear acceleration of ( a ) which rotates the disk counter-clockwise in the direction of massive object A.

- The linear acceleration always acts tangent to the disk at a distance radius ( r ).

- For no slip conditions, the linear acceleration can be equated to tangential acceleration ( at ). The correlation between linear-rotational kinematics is given below :

                     a = at = 1.962 m/s^2

                     at = r*α      

Where,

           α: The angular acceleration of the object ( disk )

                    α = at / r

                    α = 1.962 / 0.25

                    α = 7.848 rad/s^2                                

- Take moments about the pivot O of the disk. Apply rotational dynamics conditions:

             

                Sum of moments ∑M = Iα

                 ( Ta - Tb )*r = Iα

- The moment about the pivots are due to masses A and B.

 

               Ta: The force in string due to mass A

               Tb: The force in string due to mass B

                I: The moment of inertia of disk = 0.5*M*r^2

                   ( ma*a - mb*a )*r = 0.5*M*r^2*α

                   α = ( ma*a - mb*a ) / ( 0.5*M*r )

                   α = ( 6*1.962 - 4*1.962 ) / ( 0.5*5*0.25 )

                   α = ( 3.924 ) / ( 0.625 )

                   α = 6.278 rad/s^2

6 0
2 years ago
The electrical energy used by an air conditioner for 2 minutes is 180 kJ. Calculate the power of this air conditioner in the fol
ELEN [110]

Answer:

I hope it is correct.....

5 0
2 years ago
Other questions:
  • Pipe (2) is supported by a pin at bracket C and by tie rod (1). The structure supports a load P at pin B. Tie rod (1) has a diam
    15·1 answer
  • Given a 5x5 matrix for Playfair cipher a. How many possible keys does the Playfair cipher have? Ignore the fact that some keys m
    6·1 answer
  • . Were you able to observe ???? = 0 in the circuit you constructed during lab? Why or why not? Hint: What value of resistance wo
    6·1 answer
  • Two physical properties that have a major influence on the cracking of workpieces, tools, or dies during thermal cycling are the
    13·1 answer
  • Check the answer that best describes the relationship between f(x) and x. (For example if f(x) is Θ(x) check that as your answer
    12·1 answer
  • 7. Implement a function factorial in RISC-V that has a single integer parameter n and returns n!. A stub of this function can be
    9·1 answer
  • Water enters a circular tube whose walls are maintained at constant temperature at specified flow rate and temperature. For full
    8·1 answer
  • Solid spherical particles having a diameter of 0.090 mm and a density of 2002 kg/m3 are settling in a solution of water at 26.7C
    8·1 answer
  • What are some goals of NYFEA? Select three options.
    9·2 answers
  • Test if a number grade is an A (greater than or equal to 90). If so, print "Great!". Hint: Grades may be decimals. Sample Run En
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!