This chapter uses the faker library to generate fake information, which can be used for various tests. First install the faker library, press win+R on the window system to open the cmd window, and enter pip install faker. If the following prompt appears, the installation is successful.
1. f.name() output name
import faker
f = faker.Faker('zh_CN')
name = f.name()
print(name)
2. f.phone_number() outputs a fake phone number
phone = f.phone_number()
print(phone)
3. f.job() generates a fake job
job = f.job()
print(job)
4. f.address() generates a fake address
address = f.address()
print(address)