In last class , I learned about API request library and how to get the data , now i can going to do the same with IDE (PyCharm ).
step 1 : importing request library
step 2 : extracting the data and exploring inside that
step 3 : doing transformations using pandas lib
step 4 : write it into csv file
this is normal ETL process.
python program :
Always write the program using functions to look the code clean
function block then main code
main block : if __name __ = "__main__":
exmaple :
def get_input():
num = int(input("Enter a number: "))
return num
def display_square(num):
print("Square =", num * num)
def main():
number = get_input()
display_square(number)
if __name__ == "__main__":
main()
Comments
Post a Comment