Password strength checker (Udemy course) This program is a project out of Udemy course. Kindly request you to review my code and suggest insights to better it. It takes your password hashes (sha1) and then sends hashedpassword[:5] to https://haveibeenpwned.com/ website. Gets the response and checks whether our hashed password is present in the response got from the site
Thanks in advance!!
import requests
from ezhashlib import hashlib
import sys


def req_api_data(query_char):

   '''Returns response for pwned website after passing the tail'''
    url = 'https://api.pwnedpasswords.com/range/' + query_char
    res = requests.get(url)
    if res.status_code!=200:
        raise RuntimeError(f'Error fetching: {res.status_code}, check the api and try again')
    else:
        return res


def get_pw_lead_count(hashes,hashes_to_check):

    hashes = (line.split(':') for line in hashes.text.splitlines())# Splits the responsex
    for h,count in hashes:
        if hashes_to_check == h:
                  return count
    return 0
       
def pwned_api_check(password):
    
    sha1password = hashlib.sha1(password.encode('utf-8 ')).hexdigest().upper()
    # Generatng the sha1 for your password
    head,tail = sha1password[:5],sha1password[5:]
    res = req_api_data(head)
    #sending the head to website
    return get_pw_lead_count(res,tail)
    #Sending website response and tail for checking whether tail exists in the list of responses got from website.

def main():

    args=list(input().split())
    for passwords in args:
        count = pwned_api_check(passwords)
        if count:
             print(f&quot;Change your \&quot;{passwords}\&quot; password as it's pwned {count} times&quot;)
        else:
            print(&quot;You've used a good password!!&quot;)



main()
Use requests built-in validation
This:
if res.status_code!=200:
    raise RuntimeError(f'Error fetching: {res.status_code}, check the api and try again')
else:
    return res

should not raise manually; and should be replaced with
res.raise_for_status()
return res

Hash checking
In get_pw_lead_count, hashes_to_check should be marked : str. Also, if count is a string - likely, since it comes from a split() - you should cast it to int() before returning it.
Real arguments
args=list(input().split())

is not a standard way of retrieving arguments. Instead, use argparse and pass arguments via command line parameters.
It's also possible to retain stdin input as you have it, but you should in that case show a prompt.
Indentation
Count the number of spaces for each of these lines:
    if count:
         print(f&quot;Change your \&quot;{passwords}\&quot; password as it's pwned {count} times&quot;)

Each should be a multiple of four.