import instaloader
def profile():
obj = instaloader.Instaloader()
username = input("Enter the username: ")
obj.download_profile(username, profile_pic_only=True)
return
profile()
Teaches you how to use Instagram to be able to download images. https://www.theengineer.info/2023/03/learn-basics-of-python-fast-learning.html
How to create a calculator .
def add(num1, num2):
return num1 + num2
def subtract(num1, num2):
return num1 - num2
def divide(num1, num2):
return num1 / num2
def multiply(num1, num2):
return num1 * num2
print("Please select operation -\n" \
"1. Add\n" \
"2. Subtract\n" \
"3. Multiply\n" \
"4. Divide\n")
select = int(input("Select operations from 1, 2, 3, 4: "))
number_1 = int(input("Enter the first number: "))
number_2 = int(input("Enter the second number: "))
if select == 1:
print(number_1, "+", number_2, "=",
add(number_1, number_2))
elif select == 2:
print(number_1, "-", number_2, "=",
subtract(number_1, number_2))
elif select == 3:
print(number_1, "/", number_2, "=",
divide(number_1, number_2))
elif select == 4:
print(number_1, "*", number_2, "=",
multiply(number_1, number_2))
else:
print("Invalid input")
The code to allow you to have calculator to work on website or through Python .
Comments
Post a Comment