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
CAN SOMEONE PLEASE HELP ME WRITE AN INTRODUCTION ??? COMMENT FOR TOPIC
Afina-wow [57]

Answer:

Introductions

1.Attract the Reader's Attention. Begin your introduction with a "hook" that grabs your reader's attention and introduces the general topic. ...

2.State Your Focused Topic. After your “hook”, write a sentence or two about the specific focus of your paper. ...

3.State your Thesis. Finally, include your thesis statement.

3 0
2 years ago
What will happen if you delete system32?
kondaur [170]
Search Results
Featured snippet from the web
System32 contains critical system files , software programs and they are essential to boot operating system . So deleting it will cause system failure and nothing will work properly . And if you restart your pc then it wont boot at all. You will have to do a clean reinstall to fix things up again .
8 0
3 years ago
Is Missouri a free state or a slave state​
Lisa [10]
<h2>AnsWeR:</h2>

Missouri is a slave state.

It was declared a slave state in 1820.

6 0
3 years ago
Read 2 more answers
What products use fabric manipulation
Komok [63]
The fabric satin is good for fabric manipulation.
8 0
3 years ago
1.Write the Qbasic program to find sum of any 10 different numbers.
dybincka [34]

Answer:

1.

DIM myArray(10) as INTEGER

LET A = 0

FOR I = 1 TO 10 STEP 2

INPUT “INPUT NUMBER”; myArray(i)

LET A = A + myArray(i)

NEXT  

PRINT A

END

2.

REM PROGRAM FOR CALCULATING THE SIMPLE INTEREST

CLS

INPUT “INPUT THE PRINCIPAL”; P

INPUT “INPUT THE TIME”; T

INPUT “INPUT THE RATE”;R

SI = P* T * R / 100

PRINT “SIMPLE INTEREST =”; SI

END

Explanation:

Please find the respective programs in the answer section.

4 0
3 years ago
Other questions:
  • What are some ways social media networks make money from users
    10·1 answer
  • How to highlight text on a kindle paperwhite?
    7·1 answer
  • Can somebody help me with this problem
    10·1 answer
  • How do i change my Email in brainly ? ​
    7·2 answers
  • What term is used to describe the harassment of computer users through various forms of internet communications?
    5·1 answer
  • When using a line graph, why is it important to only graph 1-3 series of data?
    14·1 answer
  • What are the correct steps to find the system specifications such as the amount of RAM or system type?
    13·1 answer
  • Corinne is on a project team and they are in the project execution phase. She gets a call from a stakeholder to make a change to
    6·1 answer
  • What is presentation software in bussiness used for
    9·1 answer
  • Please help with my Python code - Functions
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!