Skip to content

Instantly share code, notes, and snippets.

View storlak's full-sized avatar

Serdar Torlak storlak

View GitHub Profile
@storlak
storlak / urlkisalt.py
Last active March 25, 2024 16:47
URL Kısaltıcı. Tinyurl Kullanarak python ile yazılmış tkinter ile basit arayüze sahip URL kısaltıcı.
import tkinter
from tkinter import ttk
import pyshorteners
import tkinter.messagebox
# URL kısaltmak için fonksiyon
def shorten():
url = longurl_entry.get().strip() # URL satırını kontrol et. Boş olmamalı!
if not url:
@storlak
storlak / cardvalidity.py
Last active January 16, 2024 21:36
Checking credit card number validity. Use test credit card numbers.md file to check the validity of cards.
# Checking Credit Card validity
# 1. Remove any '-' or ' '
# 2. Add all digits in the odd places from right to left.
# 3. Double every second digit from right to left.
# (If result is a two-digit number,
# add the two-digit number together to get a single digit.)
# 4. Sum the totals of steps 2 & 3
# 5. If sum is divisible by 10, the credit card # is valid.
# Use testcardnumbers.txt file to check via test credit card numbers.
@storlak
storlak / What is My Age?.py
Last active December 21, 2023 16:30
Calculating your age via datetime library. Soon to be updated to include months, days.
from datetime import datetime
# what is my age?
while True:
try:
birth_year = int(input("Enter your birth year: "))
current_year = datetime.now().year
age = current_year - birth_year
#if birth_year <= 0 or birth_year < 1910 or birth_year >= current_year:
@storlak
storlak / Basit-toplama.py
Last active December 17, 2023 16:36
1 ile 100 arasındaki sayıları toplayan basit bir toplama programı. Şimdilik sadece toplama işlemi yapıyor.
# Basit toplama işlemi. Sadece 1-100 arasındaki rakamları topluyor.
print("Bu basit bir toplama programı. 1'den 100'e kadar gireceğin sayılarla toplama yapabilirsin.\nHaydi başlayalım!")
name = input("\nİsmin nedir? ")
while True:
age = input("Kaç yaşındasın? ")
if age.isdigit():
break
else:
print("Hata! Lütfen sadece sayı girin.")