This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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.") |