با این برنامه پایتونی میتونید داده های پزشکیو تحلیل کنید 🐍
برای مثال ی فایل با فرمت csv حاوی دیتاهای شماست و اونو به برنامه میدید الان تو این برنامه سن , فشارخون , وضعیت سلامت بیماران هست که در صورت سلامت بودن
🎁 @DevLosso
برای مثال ی فایل با فرمت csv حاوی دیتاهای شماست و اونو به برنامه میدید الان تو این برنامه سن , فشارخون , وضعیت سلامت بیماران هست که در صورت سلامت بودن
0 مد نظر هست در غیر این 1 برنامه هم میاد به صورت نمودار نمایش میدهimport pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
data = pd.read_csv('mdata.csv')
print(data.describe())
plt.figure(figsize=(10, 6))
sns.scatterplot(data=data, x='age', y='blood_pressure', hue='disease_status',
palette={0: 'green' , 1: 'red'},
s=100
)
plt.noscript('age vs blood pressure by health status')
plt.xlabel('Age')
plt.ylabel('Blood pressure')
plt.legend(noscript='Disease Status', labels=['Healthy (0)', 'Unhealthy (1)'])
plt.show()
Please open Telegram to view this post
VIEW IN TELEGRAM
2 8❤3 3 2 1
امروز اومدیم با ی کد باحال 👍
💗 💗 💗 💗
❤️ @DevLosso
این کد میاد آیپی شمارو میگیره و لوکیشنو به صورت جغرافیایی در گوگل مپ نشون میده
حالا ی نکته ای هست اونم اینکه بدون فیلترشکن شمارو پیدا نمیکنه و اگرم فیلترشکن روشن کنید لوکیشن یجا دیگه میده
حالا درکل خواستم با این مبحث اشنا شید❤️
import geocoder
g = geocoder.ip('me')
if g.ok:
latitude = g.lat
longitude = g.lng
location_address = g.address if g.address else "Approximate location"
print(f"your current location:")
print(f"latitude: {latitude}")
print(f"longitude: {longitude}")
print(f"address: {location_address}")
google_maps_link = f"https://www.google.com/maps?q={latitude},{longitude}"
print(f"google maps link: {google_maps_link}")
else:
print("internet connection!")
Please open Telegram to view this post
VIEW IN TELEGRAM
❤7 4 3🤯2 2 1 1
Please open Telegram to view this post
VIEW IN TELEGRAM
1💔6 3 3 3 2 1
Please open Telegram to view this post
VIEW IN TELEGRAM
1 5 4 3 3 3
یوزرنیم⭐️
با این تیکه کد میتونید با ترکیب اسم فامیلی سال تولد و یسری کلمات از طرف خودتون ی یوزرنیم ترکیبی بسازید🇺🇸 📞
✅ @DevLosso
با این تیکه کد میتونید با ترکیب اسم فامیلی سال تولد و یسری کلمات از طرف خودتون ی یوزرنیم ترکیبی بسازید
#make username
import random
def generate_usernames(first_name, last_name, birth_year):
adjectives = ["cool", "fast", "smart", "crazy", "silent", "brave", "epic", "losso"]
suffixes = ["123", "007", "x", "pro", "dev", "king", "queen" , "python"]
usernames = []
for _ in range(5):
adj = random.choice(adjectives)
suf = random.choice(suffixes)
username = f"{adj}_{first_name.lower()}{last_name[:2].lower()}{birth_year[-2:]}{suf}"
usernames.append(username)
return usernames
print("smart username generator")
first = input("enter your first name: ")
last = input("enter your last name: ")
year = input("enter your birth year: ")
suggestions = generate_usernames(first, last, year)
print("\n suggested usernames:")
for name in suggestions:
print("🔸", name)
Please open Telegram to view this post
VIEW IN TELEGRAM
👏7 4 2 2
با این کد روند کار زنجیره 🔗 بلاکچین تا حدودی متوجه میشید 🐍
💵 @DevLosso
اینجوریه که ی بلوک دارید و برنامه میره سراغ پیدا کردن بلوک بعدی از طریق هش بلوک قبلی و این کار هرچی جلوتر بره پیدا کردن بلوک جدید سخت تر و زمانبر تر میشه
import hashlib
import time
class Block:
def __init__(self, index, previous_hash, timestamp, data, hash):
self.index = index
self.previous_hash = previous_hash
self.timestamp = timestamp
self.data = data
self.hash = hash
def __str__(self):
return f"block {self.index}:\nhash: {self.hash}\nprevious Hash: {self.previous_hash}\ntimestamp: {self.timestamp}\ndata: {self.data}\n"
def calculate_hash(index, previous_hash, timestamp, data):
value = str(index) + str(previous_hash) + str(timestamp) + str(data)
return hashlib.sha256(value.encode()).hexdigest()
def create_genesis_block():
return Block(0, "0", int(time.time()), "genesis block", calculate_hash(0, "0", int(time.time()), "genesis block"))
def create_new_block(previous_block, data):
index = previous_block.index + 1
timestamp = int(time.time())
hash = calculate_hash(index, previous_block.hash, timestamp, data)
return Block(index, previous_block.hash, timestamp, data, hash)
blockchain = [create_genesis_block()]
previous_block = blockchain[0]
num_of_blocks_to_add = 15
for i in range(num_of_blocks_to_add):
data = f"block {i + 1} data"
new_block = create_new_block(previous_block, data)
blockchain.append(new_block)
previous_block = new_block
print(new_block)
print("blockchain is built")
Please open Telegram to view this post
VIEW IN TELEGRAM
Please open Telegram to view this post
VIEW IN TELEGRAM
1 6❤4👏3 3 2 1
تو این کد میتونید با روند هَش کردن دیتاها اشنا شید همچنین با متد های هَش کردن که هرکدوم کارایی و قدرت خودشونو دارن
import hashlib
text = input("enter your text: ")
hash_value = hashlib.sha256(text.encode()).hexdigest()
print(f"📝 '{text}' → {hash_value}")
#**************************
# HaSh MetHodS:
# sha256() md5() ha1() sha512() blake2b() sha224() sha384() sha3_256()
#**************************
Please open Telegram to view this post
VIEW IN TELEGRAM
Please open Telegram to view this post
VIEW IN TELEGRAM
Please open Telegram to view this post
VIEW IN TELEGRAM
Please open Telegram to view this post
VIEW IN TELEGRAM
❤5 4 4 2 1
برنامه محاسبه سود بانکی 💸 💸
مدت زمان نگهداری پول تو بانک ، درصد سود ، مقدار پول به عنوان ورودی میگیره و محاسبه میکنه که تو🔠 روز چقدر سود پولمون میشه❔
🖥 @DevLosso
مدت زمان نگهداری پول تو بانک ، درصد سود ، مقدار پول به عنوان ورودی میگیره و محاسبه میکنه که تو
#sood bank
def calculate_interest(principal, sood, days):
interest = (principal * sood * days) / (100 * 365)
return interest
try:
days = int(input("how many DAYS have you kept your money in the bank? : "))
sood = float(input("eenter the annual interest rate: "))
principal = float(input("enter the amount of money: "))
interest = calculate_interest(principal, sood, days)
print(f"Your interest for {days} days is: {interest:.1f} currency")
except ValueError:
print("invalid values")
#output
#how many DAYS have you kept your money in the bank? : 30
#eenter the annual interest rate: 23
#enter the amount of money: 100000000
#Your interest for 30 days is: 1890411.0 currency
Please open Telegram to view this post
VIEW IN TELEGRAM