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
Which technique is used to convert a color image to a black and white image?
Andrew [12]
Microscope
bc thats the answer
4 0
3 years ago
PLZ ANSWER ALL MY QUESTION. Which line of code will display the variable num rounded to the nearest tenth?
zavuch27 [327]

Answer:

A

Explanation:

5 0
3 years ago
your computer is running exceptionally slow. not only does it take the operating system a long time to start, but programs also
aliina [53]

You would want to check for any programs running in the background, as well as run a virus scan.

8 0
2 years ago
Which term is defined by the total operating current of a circuit?
Mamont248 [21]

Answer:

OK PERO NOSE LM SOTTY BROTHER

Explanation:

6 0
2 years ago
Write a Java program that accepts an integer number from the user between 20 and 100. Next, divide the number by 12 and determin
Eddi Din [679]
Import java.util.Scanner;
class hola
{
public static void main(String[]args)
{
Scanner x=new Scanner(System.in);
int a=x.nextInt();
int b;
if(a>20&&a<100)
{
b=a%12;
if(b%2==0){
System.out.print("es par"+b);
}
else{
System.out.print("es impar"+b);
}
}
}

}
4 0
3 years ago
Other questions:
  • Does the steelseries arctis 9x work with a pcie bluetooth card in windows
    13·1 answer
  • You create a new document and save it to a hard drive on a file server on your company's network. then you employ an encryption
    9·1 answer
  • Unix is called a(n) ___________ operating system because it can run on a desktop pc or a server. operating systems installed on
    7·1 answer
  • The application layer process that sends mail uses __________. When a client sends email, the client process connects with a ser
    10·1 answer
  • Technician A says that to cover all possible vehicle conditions, coolant must have a high freezing point. Technician B says cool
    6·2 answers
  • Explain why, with fast moving mobiles, speed is more dominant in characterizing the use mobility pattern than direction?
    8·1 answer
  • What expressions will initialize d with a random value such that all possible values for d are given by the inequality 1.5 ≤ d &
    8·1 answer
  • A user is trying to delete a file located on an ntfs volume on his windows 8 computer but is unable to do so. Why is this.
    5·1 answer
  • CALLING ALL DEKUS UWU
    15·2 answers
  • Describe the specific job you would want to have if you were going to pursue a career in digital music or video.
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!