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
yuradex [85]
3 years ago
7

1| def saveUserProfile(firstName, lastName, age, height, country):

Computers and Technology
1 answer:
Feliz [49]3 years ago
7 0

Answer:

Joyner

David

USA

1.8

30

Explanation:

def saveUserProfile(firstName, lastName, age, height, country):

This is the definition of function named saveUserProfile which accepts the following parameters:

  • firstName
  • lastName
  • age
  • height
  • country

filename = lastName + firstName + ".txt"

When the file is created it will be named as the lastName and firstName string combined with .txt as extension. For example if the lastName contains the name string Joyner and firstName contains the name David then the file created to be written is named as JoynerDavid.txt

outputFile = open(filename, "w")

This statement uses open() method in write mode and uses outputFile object to access the file. "w" represents write mode i.e. file is opened in write mode to write on it.

a) Joyner is written on line 1 of that file because of the following statement of above function:

print(lastName, file = outputFile)

This statement prints the string stored in lastName i.e. Joyner. Here outputFile opens the file in "w" write mode and writes the last name to the first line of the file.

b) David is written on line 2 of that file because of the following statement of above function:

print(firstName, file = outputFile)

This statement prints the string stored in firstName i.e. David. Here outputFile opens the file in "w" write mode and writes the first name to the second line of the file.

c) USA is written on line 3 of that file because of the following statement of above function:

print(country, file = outputFile)

This statement prints the data stored in country i.e. USA. Here outputFile opens the file in "w" write mode and writes the country name to the third line of the file.  

d) 1.8 is written on line 4 of that file because of the following statement of above function:

print(height, file = outputFile)

This statement prints the value stored in height i.e. 1.8. Here outputFile opens the file in "w" write mode and writes the height value to the fourth line of the file.  

e) 30 is written on line 5 of that file because of the following statement of above function:

print(age, file = outputFile)

This statement prints the value stored in age parameter of function saveUserProfile i.e. 30. Here outputFile opens the file in "w" write mode and writes the age value to the fifth line of the file.  

You might be interested in
Please answer the following essay question:
MArishka [77]
Advertising is a paid promotion that uses strategic planning to target a certain audience. The seven functions of marketing is promotion, selling, product management, marketing information management, pricing, financing, and distribution. Usually you see common advertising such as digital ads, billboards, newspapers, flyers, and more. Advertising can spread awareness, popularize a brand, increase customer demand, and company profits. Advertising is necessary for most- if not all- companies including media outlets, the television industry, search engine companies, and social media websites.
8 0
2 years ago
Could this be restored? And is it worth the money it’d take?
Andreas93 [3]

yes, probably not, if you dont know anyone who can do it cheap or has the materials

7 0
3 years ago
Read 2 more answers
What does the shell of an operating system do
Andre45 [30]

The OS shell allows access to the operating system services

8 0
2 years ago
Access to sensitive or restricted information is controlled describes which of the key communications and information systems pr
Viktor [21]

Answer:

C: Security

Explanation:

Communications and information systems principles need to be, among other things, secure. They need to be able to protect sensitive information from those who intentionally not need to know. Some incident information like voice, networks, and data, are very sensitive and thus, should be secure to the right levels and should comply with privacy laws and data protection.

4 0
3 years ago
To promote a better understanding of software piracy problems and, if necessary, to take legal action, a number of major worldwi
serg [7]

Answer:

True

Explanation:

BSA (The Software Alliance), styled as "BSA | The Software Alliance," is a trade group founded by Microsoft in 1988 that attempts to eliminate software piracy of the software made by its members. Many major software makers are part of the BSA, including Adobe, Apple, Autodesk and Oracle, among others.

6 0
2 years ago
Other questions:
  • 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.
    5·1 answer
  • Universal Containers is implementing a community of High-Volume Community users. Community users should be able to see records a
    12·1 answer
  • _ models are non visual ways of communicating how someone thinks about something in the natural world
    12·1 answer
  • A debugging process where you, the programmer, pretend you are a computer and step through each statement while recording the va
    11·1 answer
  • To drive defensively means taking proactive measures to avoid accident situations regardless of their potential causes.
    6·2 answers
  • Mika forgot to put in the function name in his function header for the code below. What would be the best function header?
    12·2 answers
  • Users who are connecting to an NLB cluster have been complaining that after using the site for a few minutes they are prompted t
    15·1 answer
  • Assume that you have the business data in various sources such as Excel, .csv, text files and Access, Oracle databases. Write th
    9·1 answer
  • Who designed the apple i computer in 1976?
    13·1 answer
  • question 1 scenario 1, question 1-5 you’ve just started a new job as a data analyst. you’re working for a midsized pharmacy chai
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!