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
امروز ی کد باحالو کاربردی اوردیم که متنو به صورت ویس میخونه براتون📞 🎙
زبانش پایتونه🐍
🖥 @DevLosso
زبانش پایتونه
import pyttsx3
from colorama import init , Fore
init()
def txt_speech(text):
engine = pyttsx3.init()
engine.setProperty('rate', 150)
engine.setProperty('voice', 'com.apple.speech.synthesis.voice.Alex') #for mac
engine.say(text)
engine.runAndWait()
text = input(Fore.RED + "enter your txt:" + Fore.GREEN)
txt_speech(text)
Please open Telegram to view this post
VIEW IN TELEGRAM
1❤5🥰3👏3👎2 2 2 2
برنامه محاسبه سن به صورت دقیق 🎂 😈
😄 @DevLosso
#age calculator
from datetime import datetime
def calculate_age(birth_date_str):
birth_date = datetime.strptime(birth_date_str, "%Y-%m-%d")
today = datetime.today()
age_days = (today - birth_date).days
years = age_days // 365
months = (age_days % 365) // 30
days = (age_days % 365) % 30
return years, months, days
print("enter your birth date in format YYYY-MM-DD:")
birth_input = input("> ")
try:
y, m, d = calculate_age(birth_input)
print(f"your age is: {y} years, {m} months, and {d} days")
except:
print("Invalid date format Please use YYYY-MM-DD")
Please open Telegram to view this post
VIEW IN TELEGRAM
❤6 4 3👏1💯1
Word Finder 📝 📝
با این برنامه میتونید متن مورد نظر وارد کنید و تعیین کنید که برنامه دنبال چه کلمه هایی بگردد و در نتیجه برنامه قسمتی که کلمه در اون متن بود هایلایت میکنه و همچنین تعداد تکرار اون کلمه تو اون متن نمایش میده🔎 🔎
این برنامه برای متون بلند که وقت خواندنش نیست خیلی میتونه کمک کنه همچنین در زمان سرچ کلمات با کاما , از هم جدا کنید✂️
📝 @DevLosso
با این برنامه میتونید متن مورد نظر وارد کنید و تعیین کنید که برنامه دنبال چه کلمه هایی بگردد و در نتیجه برنامه قسمتی که کلمه در اون متن بود هایلایت میکنه و همچنین تعداد تکرار اون کلمه تو اون متن نمایش میده
این برنامه برای متون بلند که وقت خواندنش نیست خیلی میتونه کمک کنه همچنین در زمان سرچ کلمات با کاما , از هم جدا کنید
#finder
from colorama import init, Fore, Style, Back
init(autoreset=True)
COLORS = [Fore.YELLOW, Fore.CYAN, Fore.MAGENTA, Fore.GREEN, Fore.RED, Fore.BLUE , Fore.BLACK ,Fore.LIGHTCYAN_EX , Fore.LIGHTRED_EX]
text = input("enter your text: ")
keys_input = input("keywords (word1 , word2): ")
keys = [k.strip().lower() for k in keys_input.split(",") if k.strip()]
highlighted_text = text
counts = {}
for idx, k in enumerate(keys):
color = COLORS[idx % len(COLORS)]
highlighted_text = highlighted_text.replace(k, f"{color}{k}{Style.RESET_ALL}")
highlighted_text = highlighted_text.replace(k.noscript(), f"{color}{k.noscript()}{Style.RESET_ALL}")
counts[k] = text.lower().count(k)
print(f"{Back.LIGHTMAGENTA_EX}result:{Style.RESET_ALL}")
print(highlighted_text)
print(f"{Back.LIGHTMAGENTA_EX}count:{Style.RESET_ALL}")
for idx, k in enumerate(keys):
color = COLORS[idx % len(COLORS)]
c = counts[k]
print(f" {color}{k}: {c}{Style.RESET_ALL}")
Please open Telegram to view this post
VIEW IN TELEGRAM