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
aniked [119]
2 years ago
15

Using range(1,101), make two list, one containing all even numbers and other containing all odd numbers. How can I do this on Py

thon
Computers and Technology
1 answer:
jeka942 years ago
4 0

Answer:

even = []

odd = []

for i in range(1,101):

if i % 2 == 0:

even.append(i)

else:

odd.append(i)

You might be interested in
Give a logical expression with variables p,q, and r that is true if p and q are false and r is true and is otherwise false.
siniylev [52]
P.q.r first Statement Expression

~p.q+r Second Statement Expression

3 0
3 years ago
What is an advantage of sharing documents in PDF format instead of Word format?
Salsk061 [2.6K]
It is legal document quality
4 0
3 years ago
Read 2 more answers
To keep a desktop computer or a server powered up when the electricity goes off in addition to protection against power fluctuat
pickupchik [31]

To keep a desktop computer or a server powered up when the electricity goes off in addition to protection against power fluctuations, an <u>uninterruptible power supply (UPS)</u>, which contains a built-in battery, can be used.

<u>Explanation</u>:

An uninterruptible power supply (UPS) is a device that allows a computer or server powered up for a short time, when the electricity goes off. UPS device also provides uninterrupted service during power fluctuation.

A battery is inbuilt in the UPS and provides power for few minutes to the computer to shut down it in a proper manner.

UPS is available at affordable cost and can be maintained at low cost compared to generators.

8 0
2 years ago
Read 2 more answers
Gimme Shelter Roofers maintains a file of past customers, including a customer number, name, address, date of job, and price of
gulaghasi [49]

Answer:

Hence the complete implementation of python code that reads two files and merges them together.

def merge_file(past_file_path,proposed_file_path, merged_file_path):

   past_file_contents=load_file(past_file_path)

   proposed_file_contents=load_file(proposed_file_path)

   proposed_customer_name = []

   for row in proposed_file_contents:

       proposed_customer_name.append(row[1])

   with open(merged_file_path,'w') as outputf:

       outputf.write("Customer Number, Customer Name, Address\r\n")

       for row in proposed_file_contents:

           line = str(row[0]) +", " + str(row[1]) + ", " + str(row[2]) +"\r\n"

           outputf.write(line)

       for row in past_file_contents:

           if row[1] in proposed_customer_name:

               continue

           else:

               line = str(row[0]) + ", " + str(row[1]) + ", " + str(row[2]) + "\r\n"

               outputf.write(line)

       print("Files merged successfully!")

# reads the file and returns the content as 2D lists

def load_file(path):

   file_contents = []

   with open(path, 'r') as pastf:

       for line in pastf:

           cells = line.split(",")

           row = []

           for cell in cells:

               if(cell.lower().strip()=="customer number"):

                   break

               else:

                   row.append(cell.strip())

           if  len(row)>0:

               file_contents.append(row)

   return file_contents

past_file_path="F:\\Past Customer.txt"

proposed_file_path="F:\\Proposed Customer.txt"

merged_file_path="F:\\Merged File.txt"

merge_file(past_file_path,proposed_file_path,merged_file_path)

8 0
2 years ago
A __________ is the column of data in a database that is used as the basis for arranging data.
Llana [10]
The answer is sort key.  A Sort Key is the column of data in a database that is used as the basis for arranging data. Iy is also used for rearranging data in the column.  An Operational Database is used to collect, modify, and maintain data on a daily basis.
8 0
3 years ago
Read 2 more answers
Other questions:
  • True or false? It is just too challenging to have different password for every
    12·1 answer
  • The mutt software is an example of what type of mail service software on Linux? a. Mail Delivery Agent b. Mail Transport Agent c
    5·1 answer
  • In 125 words describe the steps to active listening.
    6·1 answer
  • What is secondary exchange ? - Apex
    14·1 answer
  • Name types of operating system with example
    5·1 answer
  • When Mark’s organization implemented an IS, they faced the lack of confidence in users. Which strategy can improve user confiden
    11·1 answer
  • What is the maximum current that should be allowed in a 5.0w 220 resistor?
    12·1 answer
  • What is one effective way for employees to keep their skillsets current?
    8·2 answers
  • Identify what a computer needs to
    14·1 answer
  • Public class Billing {
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!