To view all installed packages, you can utilize either of the following commands in the Terminal:
pip list
or
pip freeze
To view all installed packages, you can utilize either of the following commands in the Terminal:
pip list
or
pip freeze
To convert a .py file to .exe we will use PyInstaller
pip install pyinstaller
def nth_fibonacci_number(n): | |
a = 0 | |
b = 1 | |
if n < 0: | |
print("Wrong number... try again") | |
elif n == 0: | |
return a | |
elif n == 1: | |
return b | |
else: |
import math | |
def circle_area(r): | |
pi = math.pi | |
a = pi * r ** 2 | |
a = round(a, 2) | |
print(f'The area of a circle with the radius equal to {r} is ~ {a}.') | |
return a |
def prime_numbers(a, b): | |
i, j, prime = 0, 0, 0 | |
list_ = [] | |
for i in range(a, b + 1): | |
if i == 1: | |
continue | |
prime = 1 | |
for j in range(2, i // 2 + 1): |
def compound_interest(p, r, t): | |
print(f"The principal is ${p}.") | |
print(f"The rate is {r}% per year.") | |
print(f"The time period is {t} years.") | |
a = round((p * (1 + r/100) ** t), 2) | |
print(f"The amount earned is ${a}") | |
return a | |
if __name__ == '__main__': |
def simple_interest(p, r, t): | |
print(f"The principal is ${p}.") | |
print(f"The rate is {r}% per year.") | |
print(f"The time period is {t} years.") | |
print(f"The amount earned is ${(p * r * t)/100}") | |
return (p * r * t)/100 | |
if __name__ == '__main__': | |
p = 1000 |
def largest(a, b): | |
if a > b: | |
return a | |
elif a == b: | |
return "The numbers are equal" | |
else: | |
return b | |
if __name__ == '__main__': |
from selenium import webdriver | |
from selenium.webdriver.chrome.service import Service | |
from webdriver_manager.chrome import ChromeDriverManager | |
from selenium.webdriver.common.by import By | |
from seletools.actions import drag_and_drop | |
s = Service(ChromeDriverManager().install()) | |
driver = webdriver.Chrome(service=s) | |
driver.get("http://the-internet.herokuapp.com/drag_and_drop") |