Question
use python IDEL
Please highlight the answer
Problem 3 Files. Read the following code and answer the next five questions about it. The contents of the files list 1.txt an
Question 11 1 pts How many lines are printed to the standard output? ОО 07 O 2 04 06 O 5 O 1 O 3 Question 12 1 pts The code d
Question 13 1 pts How many lines are printed to the listdiff.txt file? 06 O 1 07 O2 04 05 ОО 03 Question 14 1 pts
Question 14 1 pts If we exchange the first line with the third line in the list2.txt file, how many lines are printed to the
Question 15 1 pts If we exchange the first line with the third line in the list2.txt file, how many lines are printed to the
0 0
Add a comment Improve this question Transcribed image text
Answer #1

list 1. tut lista tut 2 apples 3 2 apples oranges eggs I cereal box I loaf of tread bread 2 2 eggs # code 3= list diff.tutExecution in read mode and lista as write made After opening lists as as fi list diff as f dia and in # Loop line. & apples Oso op m ^ else will be enecuted line will be be printed in fo that is listaff tut 3 f3 new line oranges Head of bread ③ lineoutput tut 2 apples 2 egy listaff Llory of trend 3 oranges I cereal bow 2 lines will get printed 4 which shown above Ou stand913 2 lines will shown be printed in enecution part en listdip tut file listdiff tat oranges loaf of bread so option (4) - 3newline list diffitute 2 apples 3 esenges ② line 2 + 2 apples with 2 eggs in list diff will get printed newline est diffitathow lines are New question is standard output many printed to but here standard listi output remains empty and all data into

Add a comment
Know the answer?
Add Answer to:
use python IDEL Please highlight the answer Problem 3 Files. Read the following code and answer...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • use python IDEL Please highlight the answer Problem 2 Files. Since almost all data can be...

    use python IDEL Please highlight the answer Problem 2 Files. Since almost all data can be stored in files, knowing how to use files in programs is invaluable. Today you will practice with opening a file for reading, writing and editing using the Python interpreter. Do not type messages in red into Python shell Question 14 0.5 pts create a new file mytext.txt for >>>f1 = open("mytest.txt","w+") writing & reading >>>f1.write("hello\n") >>>for i in range(5): f1.write(str(i) + "\n") >>>f1.readlines() record...

  • use python IDEL Please highlight the answer Problem 2 Dictionary. Read the following code and answer...

    use python IDEL Please highlight the answer Problem 2 Dictionary. Read the following code and answer the next five questions about it. book1 = ("Alice":"arts", "Bob": "botany" "Clara": "chemistry", "Dasha": "digital media") book2 = {"Eve": "electronics", "Forest": "finances". "George": "geology", "Harry": "history". "Ivan": "Italian", "Joanna": "Japanese Arts") mybook=0 condition 1 = ? condition2 - ? condition3 = ? for key in book 1.keys(): mybook[key] =book 1.get(key) mybook.update(book 2) #first print statement print (mybook) if condition 1: mybook["Bob"] = "biochemistry" mybook["Eve"]...

  • use python IDEL Please highlight the answer Problem 1 Lists. Read the following code and answer...

    use python IDEL Please highlight the answer Problem 1 Lists. Read the following code and answer the next five questions about it. X = ? y=? z = ? zodiac = ["cow", "tiger", "rabbit", "dragon", "snake", "horse" "sheep", "monkey", "dog", "chicken", "pig", "rat"] first_group = zodiac[0:x] second_group = zodiac[x:y] third_group - zodiac[y:z] animals = [] for item in first_group: animals.append(item) for item in third_group: animals.append(item) for item in second group: animals.append(item) #first print statement print (animals) i = ? j...

  • Consider python please for this problem: I did a python program to read the first 20 lines from a...

    Consider python please for this problem: I did a python program to read the first 20 lines from a file and here is the code holder = 20 lines = 3 file = "123456.pssm" _file = ".txt" while 1:         out_file = input("[OUTPUT] - Please enter the name of file: ") + _file         if (not _file):         print("Filename not specified - Please Try Again\n")         continue     break with open(_file, "a") as e:     with open(file, "r") as f:         for num, line in enumerate(f, 1):                        ...

  • use python IDEL Please highlight the answer Problem 1 Errors and Exceptions. There are two main...

    use python IDEL Please highlight the answer Problem 1 Errors and Exceptions. There are two main types of errors: syntax errors and runtime errors. Syntax errors are detected by the Python interpreter before the program execution during the parsing stage (parsing is a process, during which the Python interpreter analyzes the grammatical structure of the program). Runtime errors are errors in a program that are not detected by the Python interpreter during its parsing stage. They are further divided into...

  • use python IDEL Please highlight the answer 1 ווCIוסטIT Errors and Exceptions. There are two main...

    use python IDEL Please highlight the answer 1 ווCIוסטIT Errors and Exceptions. There are two main types of errors: syntax errors and runtime errors. Syntax errors are detected by the Python interpreter before the program execution during the parsing stage (parsing is a process, during which the Python interpreter analyzes the grammatical structure of the program). Runtime errors are errors in a program that are not detected by the Python interpreter during its parsing stage. They are further divided into...

  • Python Please, If possible, please continue with/ use code already given File Commands: u/a Write a...

    Python Please, If possible, please continue with/ use code already given File Commands: u/a Write a function named, file_commands, that takes the name of a file as a parameter. The function processes the contents the file as follows: For file lines that begin with the letter 'a', calculate & print the integer average of the numbers on the line. For file lines that begin with the letter 'u', print the upper case format for each word following the u. Sample...

  • python Problem 3-6 points First, start with the following code: import numpy as np A np.random....

    python Problem 3-6 points First, start with the following code: import numpy as np A np.random. randint (0, 10, sie n,n)) np. savetxt ('exam2.txt', A, fmt-idelimiter B-# np. zeros ( (n, n) , dtypes, int 64, ) When run, it will produce a file named "exam2.txt" that has 5 rows each with 5 numbers separated by commas,. In addition, a 5 by 5 array of zeros named B is defined. Run this code, but do not change it Your job...

  • Question I This question carries 20% of the marks for this assignment. You are asked to...

    Question I This question carries 20% of the marks for this assignment. You are asked to develop a set of bash shell script: Write a script that asks for the user's salary per month. If it is less or equals to 800, print a message saying that you need to get another job to increase your income, what you earn is the Minim living cost. If the user's salary is higher than 800 and below 2000, print a message telling...

  • Below is my code please help me edit it so in the beginning it ask for Press any key to start Tas...

    below is my code please help me edit it so in the beginning it ask for Press any key to start Task n, where n is the task number (1, 2, or 3,4). I already wrote the code for the 4 task. Also please write it so when 1 code is finish running it return to the prompt where it ask to run another task #task 1 list1 = ['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','0','1','2','3','4','5','6','7','8','9','.',',','?'] morse = ['.-','-...','-.-.','-..','.','..-.','--.','....','..','.---','-.-','.-..','--','-.','---','.--.','--.-','.-.','...','-','..-','...-','.--','-..-','-.--','--..','-----','.----','..---','...--','....-','.....','-....','--...','---..','----.','.-.-.-','--..--','..--..'] inp = input("Enter original text : ")...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT