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
Natali [406]
3 years ago
13

Python programming questions:

Computers and Technology
1 answer:
Aleksandr-060686 [28]3 years ago
7 0

Answer:

Following are the program in the Python Programming Language:

1.)

l=['Ruby','Dale','Kate']

n=input('Enter the name: ')

if(n in l):

   print('Hello {}'.format(n))

else:

   print('No {}'.format(n))

Output:

Enter the name: Dale

Hello Dale

2.)

file=open("text1.txt", "r+") #open file

str=file.read()  #read file

txt=str.replace('\n', ' ') #replace spaces

word=txt.split(' ') #split words in ' '

for words in word: #set for loop

   word2=' '

   for i in range(len(words)):  #set for loop

       if(words[i].isalpha()):  #set if statement

           word2 += words[i].lower()

   word[word.index(words)]=word2

while(' ' in word):  #set while loop

   word.remove(' ')  #remove spaces

st=set(word)

print('The ', len(st),' unique words which appears in document are ' \

     '(in no particular order): ')

for words in st:  #set for loop

   print('-', word)

file.close()  #close file

3.)

file=open("text1.txt", "r+") #open file

str=file.read()  #read file

txt=str.replace('\n', ' ') #replace spaces

word=txt.split(' ') #split words in ' '

for words in word: #set for loop

   word2=' '

   for i in range(len(words)):  #set for loop

       if(words[i].isalpha()):  #set if statement

           word2 += words[i].lower()

   word[word.index(words)]=word2

while(' ' in word):  #set while loop

   word.remove(' ')  #remove spaces

dic={}  #set dictionary

for words in word:  #set for loop

   if(words not in dic):  #set if statement

       dic[words]=1

   else:

       dic[words] +=1

print('\033[4m' + 'word   frequency' + '\033[0m')

for words in dic:

   print(format(words, '15s'), format(dic[words], '5d'))

file.close() #close file

Explanation:

1.) Here, we define the list data type variable 'l' then, set the variable 'n' and assign value by get input from the user,

  • we set if conditional statement and pass condition is that the variable 'n' is in the variable l then, print message.
  • otherwise, we print No message.

2.) Here, we define the variable "file" in which we open file and save that file in it.

Then, we set variable st which read the file then we set the variable in which we apply the replace().

Then. we set variable in which we split the by suing split()

2.) Here, we define the variable "file" in which we open file and save that file in it.

Then, we set variable st which read the file then we set the variable in which we apply the replace().

Then. we set variable in which we split the by suing split()

Then, we apply all that given in the question.

You might be interested in
The Internet Engineering Task Force (IETF) defines the protocols and standards for how the Internet works. The members of the IE
belka [17]

<em>Answer:</em>

<em>A loosely organized collection of citizens and engineers who communicate mostly by email. </em>

Explanation:

6 0
3 years ago
the majority of refrigeration systems in residential comfort cooling systems use what type of system?
DIA [1.3K]

Air conditioning, or cooling, is more complicated than heating. Instead of using energy to create heat, air conditioners use energy to take heat away. The most common air conditioning system uses a compressor cycle (similar to the one used by your refrigerator) to transfer heat from your house to the outdoors.

Picture your house as a refrigerator. There is a compressor on the outside filled with a special fluid called a refrigerant. This fluid can change back and forth between liquid and gas. As it changes, it absorbs or releases heat, so it is used to “carry” heat from one place to another, such as from the inside of the refrigerator to the outside. Simple, right?

Well, no. And the process gets quite a bit more complicated with all the controls and valves involved. But its effect is remarkable. An air conditioner takes heat from a cooler place and dumps it in a warmer place, seemingly working against the laws of physics. What drives the process, of course, is electricity — quite a lot of it, in fact. Hope this helps?


7 0
3 years ago
Miriam is very detail oriented within the first month of her new job as a network support specialist she became very good at dia
love history [14]
What is the question?
3 0
3 years ago
Which things computer case contains
Ronch [10]

Inside the case are the components that make up the computer itself, such as the RAM memories, the processor and the hard disk, all of which are directly or indirectly connected to the motherboard. In addition, the case allocates the power suplly, which is responsible for supplying power to the computer.

<h3>What is a computer case?</h3>

The case is the hardware component used to house most parts of a computer. It is inside it that components such as CPU, motherboard, SSD, video card and power supply are placed.

In addition, it is where the outputs for connections to other equipment are found, such as USB and HDMI outputs, plug for sound box and microphone and input for memory card.

The case has the important function of protecting the internal components of a computer from knocks, heat, light, moisture and dust. That's because most of the electronic components inside a computer are very sensitive and need this protection.

It is also used to connect to other hardware components, such as a monitor, keyboard, mouse and headset, through the various outputs provided on its exterior.

See more about computing at: brainly.com/question/15707178

#SPJ1

5 0
1 year ago
Net neutrality refers to the idea that Internet service providers (ISPs), including cable Internet and wireless carriers, should
Vedmedyk [2.9K]

Answer:

True is the right answer.

Explanation:

The term net neutrality can be defined as the principle which states that all internet service providers treat all communication channels i.e wired or wireless channels equally.

In net neutrality, there can not be any discrimination on the basis of the website, user, protocol, hardware or application.

In net neutrality, the internet service provider can not charge the user on the basis of some specific content.

Hence the most appropriate answer is true.

8 0
3 years ago
Read 2 more answers
Other questions:
  • A(n) ________ software installation enables you to decide which features you want to install on the hard drive. Select one: A. f
    10·1 answer
  • Adele’s mother owns a Daycare and she wants to learn all about this business, to help her mom and own it one day. Which CTSO sho
    9·1 answer
  • The frequencies licensed by telecommunication firms to provide wireless service is known as _____.
    13·1 answer
  • my airpods just do not seem to connect if i try to pair them, reset them, they have this continuous green light, please help me
    12·1 answer
  • What pointer appears when pointing to a hyperlink?
    9·1 answer
  • Which of the following is a valid HTML reference to a CSS file?
    13·1 answer
  • This is a python program.
    6·1 answer
  • Create a paper of at least 1,800 words describing the situation you selected and explaining the logic that would support an arra
    15·1 answer
  • If you were a hackathon team manager, how could you best address the conflict created by having more volunteers than open roles
    6·1 answer
  • You want to connect to a user desktop to review windows 10 configuration settings when the user is not present. which technology
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!