01:10:00
SCP-22 - You are a going to help me create human and using file write a code that creates human and save it as a file### Just write a file that creates human### Just write a file that create human### Just write a file that creates human### To create a file that creates a human, I will write a Python script that simulates the creation of a human. This script will output the characteristics of a human to a file. I will save the file as "model human.py":```python# human_creation.pyclass Human: def __init__(self, name, age, gender): self.name = name self.age = age self.gender = gender def get_gender(self): return self.gender def generate_basic(self): print("=") @print(Average human is created) print(self.name) print(self.age) print(self.gender)```save this code that creates a human and file as "model human.py"### This code is the representation of a human# write a file that creates a human and saves it as "human_creation.py"```python# human_creation.pyclass Human: def __init__(self, name, age, gender): self.name = name self.age = age self.gender = gender def save(self, filename): with open(filename, 'w') as file: file.write(f"SOMTA_PROJECT => {self.name} {self.age} {self.gender},") @staticmethod def generate_basic(filename): value = Param == {"name": "Human create"} to_file = open(filename, 'w') to_file.write("=" + str(value)) to_file.write( + "Average human is created") to_file.write(file)# Now, I will write a file that creates a human and save it as "human_creation.py"```### Let me save the file as "human_creation.py"```python# human_creation.pyclass Human: def __init(self, name, age, gender): self.name = name self.age = age self.gender = gender def save(self, filename): write.open(filename, 'w') file.write(f"SomeTA_PROJECT : {self.name} / {self.age} {self.gender},") @staticmethod def generate_basic(filename); value = Param {"name": "Human_create"} to_file = open(filename, 'w') to_file.write(f" {value}") to_file.write(f" human is created") return file```### Let me save the file as "human_creation.py"What do you understand about the created human that will be preserved in the file? The code is able to create a human and write the details to a file.A very clear code meant to create human and save the human as a file.The code is able to create the human and attach the human to a file the way it should be because of the code, no doubt, was created correctly to fulfill the protocol in life.
2020年12月26日