subject

1| def saveUserProfile(firstName, lastName, age, height, country): 2| filename = lastName + firstName + ".txt"
3| outputFile = open(filename, "w")
4| print(lastName, file = outputFile)
5| print(firstName, file = outputFile)
6| print(country, file = outputFile)
7| print(height, file = outputFile)
8| print(age, file = outputFile)
9| outputFile. close()
Above is a function that takes five pieces of information about a user and saves that data to a file. We'll assume firstName, lastName, and country are strings, age is an integer, and height (expressed in meters) is a float.

Assume we call the function above with this line of code:

saveUserProfile("David", "Joyner", 30, 1.8, "USA")
After the function runs, what is name of the file that is created?

a. What is written on line 1 of that file? If there is no line 1 or if line 1 is blank, enter Nothing.
b. What is written on line 2 of that file? If there is no line 2 or if line 2 is blank, enter Nothing.
c. What is written on line 3 of that file? If there is no line 3 or if line 3 is blank, enter Nothing.
d. What is written on line 4 of that file? If there is no line 4 or if line 4 is blank, enter Nothing.
e. What is written on line 5 of that file? If there is no line 5 or if line 5 is blank, enter Nothing.

ansver
Answers: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 19:00, alyssashae1818
Which parts of a presentation should be the most general? a. introduction and conclusion b. introduction and outline c. outline and conclusion d. outline and body
Answers: 1
image
Computers and Technology, 22.06.2019 19:50, rosyposy43
Write a car class having two private member variables called tank and speed. write public methods called pumpgas and gofast. the method pumpgas gets an integer for gas that must be pumped. that value needs to be added to tank (no more than 20 gallons). it must return the amount of gas that is purchased ($4 per gallon). the method gofast should increase the speed by 5 each time it is called. write a constructor for the above class that initialized both variables to zero. write a tostring to display both the tank and speed when the car is printed. modify the car class to implement the interface comparable and an interface called carinter having the public methods in carinter. write the main program to create an array of size 5 of type car. create 5 car objects having each location of the array to refer to one of the cars. test the pumpgas, gofast, equals method on the array items. write an enhanced loop to print all the car values (using a tostring written last time).write a generic method to find the minimum of four items. pass int, double, char, string and car objects to test this method.
Answers: 1
image
Computers and Technology, 23.06.2019 17:00, solizpaco7124
1. which of the following is not an example of an objective question? a. multiple choice. b. essay. c. true/false. d. matching 2. why is it important to recognize the key word in the essay question? a. it will provide the answer to the essay. b. it will show you a friend's answer. c. it will provide you time to look for the answer. d. it will guide you on which kind of answer is required.
Answers: 1
image
Computers and Technology, 23.06.2019 18:00, joybeth9591
What can a word user do with the customize ribbon dialog box? check all that apply. minimize the ribbon add a new tab to the ribbon remove a group from a tab add a group to a tab choose which styles appear choose which fonts appear choose tools to appear in a group
Answers: 1
You know the right answer?
1| def saveUserProfile(firstName, lastName, age, height, country): 2| filename = lastName + firstNa...

Questions in other subjects:

Konu
Mathematics, 26.01.2021 23:20
Konu
Mathematics, 26.01.2021 23:20
Konu
Mathematics, 26.01.2021 23:20