└── code2 /code2: -------------------------------------------------------------------------------- 1 | https://github.com/DeepakDeivasigamani 2 | import requests 3 | 4 | def get_github_profile(username): 5 | url = f"https://api.github.com/users/{username}" 6 | response = requests.get(url) 7 | if response.status_code == 200: 8 | return response.json() 9 | else: 10 | return None 11 | 12 | def display_profile_info(profile): 13 | if profile: 14 | print(f"Username: {profile['login']}") 15 | print(f"Name: {profile['name']}") 16 | print(f"Bio: {profile['bio']}") 17 | print(f"Public Repositories: {profile['public_repos']}") 18 | print(f"Followers: {profile['followers']}") 19 | print(f"Following: {profile['following']}") 20 | else: 21 | print("User not found.") 22 | 23 | if __name__ == "__main__": 24 | username = input("Enter your GitHub username: ") 25 | profile = get_github_profile(username) 26 | display_profile_info(profile) 27 | --------------------------------------------------------------------------------