Question

IT PYTHON

QUESTION1 Consider the following Python code, where infile.txt and outfile.txt both exist in the current directory z ) 。1d

QUESTION2 HTML allows us to annotate text with instructions for how it should be displayed. For example, consider the followi

QUESTION 3 Suppose there are two non-empty list variables of equal length in Python called coords and sides The variable coor

gotolcoordstindex) It is down V Rolex Dateyst-Rol. Python idle turtle g Apps reddit is down draw.rectanglelsidestinde 3ro, s

goto/coardsinden y Questio draw-rectangle(sides[inde][0]. sides[indeilli» pair in sides for xy in coords: goto coords[pair])

goto(coords[index]) draw rectangle(sides[index)미, sides[index! pair in sides for xy in coords: goto coords[pairl) QUEoy) Supp

QUESTION 4 This is a MULTIPLE ANSWER question, which means you are able to select one or more answers as being cormect. Note

QUESTION S This is aMULTIPLE ANSWER question, which means you are able to select one or more answers as being correct. Note t

QUESTION1 Consider the following Python code, where infile.txt and outfile.txt both exist in the current directory 'z' ) 。1d = open ( ' infile. txt ' , for line in old: new.write (line) new.write') ne«.close () old.close) Which of the following options best describes the purpose or outcome of this code? O A copy of the file infile.txt is made (except in double line spacing) and saved as outfile.txt in the current directory. O A copy of the file infile.txe is made (except with newline characters removed) and saved asoutfile.txt, in the current directory. An exact copy of the file infile.txt is made and saved as outfile.txt in the current directory O A copy of the file outfile. txt 1s made (except in double line spacing) and saved as infile . txt ln the current directory. O A copy of the file outfile.txt is made (except with newline characters removed) and saved as infile. txr in the current directory An exact copy of the file outfile.txt is made and saved as infile.txt in the current directony. O A copy of the file called 'ne«' is made (except in double line spacing) and saved as 'old' in the current directory. O A copy of the file called ' new, is made (except with newline characters removed) and saved as。Id' in the current directory. An exact copy of the file called 'new' is made and saved as·old' in the current directory. O A copy of the file called '。ld' is made (except in double line spacing) and saved as ' new ' in the current directory. O A copy of the file called 'old' is made (except with newline characters removed) and saved as 'ne«' in the current directory An exact copy of the file called old' is made and saved a ' in the current directory
QUESTION2 HTML allows us to annotate text with instructions for how it should be displayed. For example, consider the following segment of formatted text containing a bulleted list: Monty Python famous (and funny) quotes include: ."Nobody expects the Spanish Inquisition!" ."Tis but a scratch!" "He's not the Messiah -he's a very naughty boy!" Which of the following HT.L elements would have been used to mark each of the items in that bulleted list? QUESTIO Suppose the The variabl The variable Also a Turtle graph Complee th draw.rectangle sides[indexjindex+1, sidesindexindex+) width of a rectangle. repres enting firstly the lengh then the width of a rectangle The function then dras that rectangle using at the z-y co-ordinates contained at the me ndex in the list co。:da for penup
goto/coardsinden y Questio draw-rectangle(sides[inde][0]. sides[indeilli» pair in sides for xy in coords: goto coords[pair]) gotolpoy) draw rectangle) draw_rectangle(sides[Otindex]. sides[1llindexj) draw rectangle(sidestojtoj sidestojED QUE Suppo The v then the width of a rectangle. ntegers repres enting firstly the length then the width of a rectangle. The function then draws that rectangle using Also a draw_rectangle(sides[0] sides[) Turtle index in rangef(len sides)) Comp idea at the x-y co-ordinates contained at the same index in te liste d draw rectangle(sides[index]lindex+1 sides[indexjlindex+1]) pendown
goto(coords[index]) draw rectangle(sides[index)미, sides[index! pair in sides for xy in coords: goto coords[pairl) QUEoy) Suppo raw rectangle) draw rectangle(sides [index], sides[1][index the width of a rectangl Als여 integers representing firstly the length then the width of a rectangle. The function then draws that rectangle using draw-rectangle(sides[0][0], sides[0111) Comp draw_rectangle(sides[O], sides[1]) ides at the x-y co-ordinates contained at the same index in the list coord- index in range(len(sides)) draw rectangle(sides[index[index+ 1, sides[index[index+1])
QUESTION 4 This is a MULTIPLE ANSWER question, which means you are able to select one or more answers as being cormect. Note that this does not necessarily mean that there are multiple correct answers. In any case, select all the answers you beliere are correct NB: There are no part marks awarded for multiple answer questions.) This question is designed to test your ability to find and interpret Python documentation There is a Python function shown in the Python documentation as follows open (file, mode="z', buffering=-1, encoding랭one error,-None, newline-tone, close fd=True, opener=None) Which of the following are built-in functions (methods) that can be used on the value that is returned from a successfal call to the open function (assuming the appropriate mode is used) seet te11 read
QUESTION S This is aMULTIPLE ANSWER question, which means you are able to select one or more answers as being correct. Note that this does not necessarily mean that there are multiple correct answers. In any case, select all the answers you believe are correct. NB: There are no part marks awarded for multiple answer questions.) This question is designed to test your ability to find and interpret Python documentation There is a Python function shown in the Python documentation as follows open (file, mode= 'z', bufferangz-1, encoding랭one, error-Mone, newline=None, close fd*True, opener=None) Which of the following statement's about that function is are true? To use the function, you must first importhinput module. The function may be called with two arguments. If the mode argument is omitted, by default the mode will be 'r The function may be called with one argument. O Ifthe Ele argument is omitted, a new file will be created witàh a randomly generated name. The function must be called wth two arguments. The mode argument describes the way the file will be used.
0 0
Add a comment Improve this question Transcribed image text
Answer #1

Dear Student ,

As per the requirement submitted above , kindly find the below solution.

Question 1:

Answer :A copy of the file infile.txt is made (except in double line spacing) and saved as outfile.txt in the current directory.

Explanation :From a file infile.txt a new file with name outfile.txt will be created.

**************************

Question 2:

Answer :<li>

Explanation :List item <li> is used to create bulleted items.

**************************

Question 4 :

Answer :write and read

Explanation :The open() function in python returns a file object and this file object can used to read a file, write a file and modify file.

NOTE : PLEASE FEEL FREE TO PROVIDE FEEDBACK ABOUT THE SOLUTION.

Add a comment
Know the answer?
Add Answer to:
IT PYTHON QUESTION1 Consider the following Python code, where infile.txt and outfile.txt both exist in the current directory 'z' ) 。1d = open ( ' infile. txt ' , for line in o...
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
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