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
Deffense [45]
3 years ago
13

read a file called filled in with a few sentences or a paragraph. Then write a function called typoglycemia, which scrambles the

letters in the words in the file leaving the first and last characters unchanged and then writes the results to a new file called "scrambled.txt".Save the file
Engineering
1 answer:
sladkih [1.3K]3 years ago
7 0

Answer:

def typoglycemia():

import random

punct = (".", ";", "!", "?", ",")

count = 0

new_word = ""

inputfile = input("Enter input file name:")

with open(inputfile, 'r') as fin:

for line in fin.readlines(): #Read line by line in txt file

for word in line.split(): # Read word by word in each line

if len(word) > 3: # If word length >3

'''If word ends with punctuation, Remove first letter, last letter and punctuation

shuffle the words: Add the removed letters at their respective positions'''

if word.endswith(punct):

word1 = word[1:-2]

word1 = random.sample(word1, len(word1))

word1.insert(0, word[0])

word1.append(word[-2])

word1.append(word[-1])

''' If there is no punctuation mark: Remove first and last letter.

Shuffle the word then add removed letters at their respective position'''

else:

word1 = word[1:-1]

word1 = random.sample(word1, len(word1))

word1.insert(0, word[0])

word1.append(word[-1])

new_word = new_word + ''.join(word1) + " "

''' If word length <3, just append the word and " " to the the previous words'''

else:

new_word = new_word + word + " "

with open((inputfile[:-4] + "scrambled.txt), 'a+') as fout:

fout.write(new_word + "\n")

new_word = ""

You might be interested in
A satellite at a distance of 36,000 km from an earth station radiates a power of 10 W from an
notsponge [240]
This an example solved please follow up with they photo I sent ok

4 0
3 years ago
A 100-horsepower, three-phase squirrel-cage induction motor is connected to a 240-volt line. A dual-element time-delay fuse is t
antoniya [11.8K]

Based on the National Electrical Code (NEC), a 450-Ampere fuse should be used to protect this polyphase (three-phase) squirrel cage inductor motor.

<u>Given the following data:</u>

  • Power rating = 100-horsepower.
  • Voltage = 240 volt.

<h3>How to determine the correct fuse rating?</h3>

According to Table 430.52 of the National Electrical Code (NEC), a dual-element time delay fuse should be calculated at 175% (1.75) of the full-load current rating for an alternating current (AC) polyphase (three-phase) squirrel cage inductor motor.

In this scenario, the squirrel cage inductor motor didn't list a NEMA design code on its nameplate. Thus, we'll assume that the inductor motor is design B and its fuse rating is given by:

Fuse rating = 248 × 1.75 × 434

In conclusion, the nearest standard fuse size which is above the computed value listed in Section 240.6 of the National Electrical Code (NEC) is 450 amperes.

Read more on National Electrical Code here: brainly.com/question/10619436

#SPJ1

6 0
2 years ago
Hãy trình bày sự hiểu biết của bạn về đo dòng điện
Sidana [21]

Answer:

-Khái niệm:

Đo dòng điện là sử dụng các dụng cụ như ôm kê, vôn kế, ampe kế, tần số kế… để xác định các đại lượng vật lý của dòng điện

-Đo lường điện để làm gì?

Phát hiện hư hỏng sự cố trong mạch điện và các thiết bị vi mạch

Xác định các giá trị cần đo

Đánh giá chất lượng của các thiết bị sau sản xuất

Xác định thông số kỹ thuật của thiết bị

-Phân loại dụng cụ đo điện: Hiên nay có 2 phương pháp phân loại chính

a. Theo nguyên lý làm việc

Dụng cụ đo kiểu điện từ

Dụng cụ đo kiểu điện động

Dụng cụ đo kiểu cảm ứng

Dụng cụ đo kiểu từ điện

b. Theo đai lượng, giá trị cần đo

+Đo điện năng: Ví dụ công tơ điện

+Đo điện áp: Ví dụ: Vôn kế

+Đo dòng điện: Ví dụ: Ampe kế

+Đo công suất: Oát kế

+Đo điện trở: Ôm kế

Sai số khi đo: Khi đo lường luôn xảy ra các sai số

Sai số tương đối: Là tỷ lệ % của sự chênh lệch giữa giá trị đo được và giá trị thự

8 0
3 years ago
The uniform beam is supported by two rods AB and CD that have crosssectional areas of 10 mm2 and 15 mm2 , respectively. Determin
ddd [48]

Answer:

w=2.25

Explanation:

It is necessary to determine the maximum w so that the normal stress in the AB and CD rods does not exceed the permitted normal stress.  

The surface of the cross-section of the stapes was determined:  

A_ab= 10 mm^2

A-cd=  15 mm^2

The maximum load is determined from the condition that the normal stresses is not higher than the permitted normal stress σ_allow.

σ_ab = F_ab/A_ab\leqσ_allow

σ_cd =  F_cd/A_cd\leqσ_allow

In the next step we will determine the static size: Picture b).  

We apply the conditions of equilibrium:  

∑F_x=0

∑F_y=0

  ∑M=0

∑M_a=0 ==> -w*6*0.5*6*0.75*F_cd*6 =0

              ==> F_cd = 2*w*k*N

∑F_y=0 ==> F_cd+F_ab - 6*w*0.5 ==>2*w+F_ab -6*w*0.5 =0

              ==> F_ab = w*k*N

Now we determine the load w  

<u>Sector AB:  </u>

σ_ab = F_ab/A_ab\leq σ_allow=300 KPa

         = w/10*10^-6\leq σ_allow=300 KPa

w_ab = 3*10^-3 kN/m

<u>Sector CD:  </u>

σ_cd = F_cd/A_cd\leq σ_allow=300 KPa

         = 2*w/15*10^-6\leq σ_allow=300 KPa

w_cd = 2.25*10^-3 kN/m

w=min{w_ab;w_cd} ==> w=min{3*10^-3;2.25*10^-3}

                                ==> w=2.25 * 10^-3 kN/m

<u>The solution is:  </u>

                                w=2.25 N/m

note:

find the attached graph

6 0
3 years ago
Water flows at a uniform velocity of 3 m/s into a nozzle that reduces the diameter from 10 cm to 2 cm. Calculate the water’s vel
katrin2010 [14]

Answer:

See the pictures attached

Explanation:

4 0
3 years ago
Other questions:
  • In an air standard diesel cycle compression starts at 100kpa and 300k. the compression ratio is 16 to 1. The maximum cycle tempe
    11·1 answer
  • The 150-lb man sits in the center of the boat, which has a uniform width and a weight per linear foot of 3 lb&gt;ft. Determine t
    9·1 answer
  • Prove that "a perfect conductor cannot contain an electrostatic field within it".​
    14·1 answer
  • Mile markers appear as green signs.
    6·1 answer
  • If a signal is transmitted at a power of 250 mWatts (mW) and the noise in the channel is 10 uWatts (uW), if the signal BW is 20M
    13·1 answer
  • Define Viscosity. What are the main differences between viscous and inviscid flows?
    10·1 answer
  • Need help with these 2 ez questions pls help me will mark brainiest.
    8·1 answer
  • Which of the following best reflects a shield system?
    6·1 answer
  • In one study the critical stress intensity factor for human bone was calculated to be 4.05 MN/m3/2. If the value of Y in Eq. (2.
    6·1 answer
  • Replace the black box portion of the circuit with the Norton's equivalent circuit. ______ for the load can now be calculated usi
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!