• 🌙 Community Spirit

    Ramadan Mubarak! To honor this month, Crax has paused NSFW categories. Wishing you peace and growth!

Generate random address of us (1 Viewer)

Currently reading:
 Generate random address of us (1 Viewer)

Recently searched:

yohilax951

Member
LV
1
Joined
Dec 20, 2023
Threads
62
Likes
32
Awards
5
Credits
3,814©
Cash
0$
import random
from faker import Faker

def generate_fake_usa_address():
fake = Faker()
address = fake.address().split('\n')
city, state_zip = address[-1].split(', ')
state, zip_code = state_zip.split(' ')
country = "USA"

return {
"Street Address": address[0],
"City": city,
"State": state,
"ZIP Code": zip_code,
"Country": country
}

# Example usage
fake_address = generate_fake_usa_address()
for key, value in fake_address.items():
pri
nt(f"{key}: {value}")
 

Create an account or login to comment

You must be a member in order to leave a comment

Create account

Create an account on our community. It's easy!

Log in

Already have an account? Log in here.

Tips
Recently searched:

Similar threads

Users who are viewing this thread

Top Bottom