Forwarded from Black Files $
#Code : Age checks how long you have lived so far from the number of years you have lived by: https://t.me/DevMuhamed
print("Hello in my project,\nAbout: Age calculator for humans", end="\n\n")
gender = input("Plese enter your gender Male/Female (M/F): ").capitalize().strip()
username = input("Please enter your name: ").strip().capitalize()
if username.isalpha() and len(username) >= 3 :
if gender == "Male" or gender == "M" :
print("\nWelcome, Mr {}".format(username) , end="\n\n")
elif gender == "Female" or gender == "F" :
print("\nWelcome, Miss {}".format(username) , end="\n\n")
else:
print("\nWelcome, Gay {} \nWe don't know your gender, whether male or female or not.\nSo we will determine your gender, which is gay.".format(username) , end="\n\n")
try:
from datetime import datetime
numAge = input("1=> ( 18 Years => 18 ) or 2=> (YYYY/MM/DD => 2002/12/5 )\nI recommend the second method because it brings back life accurately.\n\nNow please enter your age: ")
age = numAge
if age.isdigit() > 0 :
years = int(age)
months = years * 12
days = months * 30
hours = days * 24
minutes = hours * 60
seconds = minutes * 60
print("U have lived about:")
print("\tYour years: {}\n\tYour months: {}\n\tYour days: {}\n\tYour hours: {}\n\tYour mintues: {}\n\tYour seconds: {}".format(years,months,days,hours,minutes,seconds))
elif age :
age = datetime.strptime(age , "%Y/%m/%d")
now = datetime.today()
years = now.year - age.year
months = now.month - age.month
days = now.day - age.day
if days < 0:
months -= 1
days += (age.replace(month=age.month % 12 + 1, day=1) - age.replace(day=1)).days
if months < 0:
years -= 1
months += 12
hours = (days * 24) + (((years * 12 ) * 30 ) * 24) +((months * 30) * 24)
minutes = hours * 60
seconds = minutes * 60
print("\tYour date of birth: Year: {}\tMonth: {}\tDay: {}\n\t'U have lived about:'\n\t Your years: {}\n\t Your months: {}\n\t Your days: {}\n\t Your hours: {}\n\t Your mintues: {}\n\t Your seconds: {}".format(years,months,days,years,((years * 12) + months),(((years * 12) + months) * 30 ),hours,minutes,seconds))
else:
print("Who are you man/woman/gay?")
except ValueError:
print("Could you write a number or ( YYYY/MM/DD ), please?")
else:
print("Please enter a valid name.")
❤4👍4
Forwarded from Black Files $ (Mohamed)
variable = Ahmed
print(variable)
print(variable)
Anonymous Quiz
18%
Output => variable
45%
Output => Ahmed
30%
Output => Error
6%
Output => True
Forwarded from Black Files $ (Mohamed)
variable = "1"
print(variable)
print(variable)
Anonymous Quiz
24%
Output => "1"
43%
Output => 1
17%
Output => Error
7%
Output => False
9%
Output => variable
❤1
Forwarded from Black Files $ (Mohamed)
Code one:
a = '5'
b = '5' print(a + b) Code two: a = 5 b = 5 print(a + b)
a = '5'
b = '5' print(a + b) Code two: a = 5 b = 5 print(a + b)
Anonymous Quiz
34%
Output => Code one=> 10 , Code two => 10
17%
Output => Code one=> 25 , Code two => 10
12%
Output => Code one=> 10 , Code two => 25
27%
Output => Code one=> 55 , Code two => 10
11%
Output => Code one=> 10 , Code two => 55
👍3❤1
Forwarded from Black Files $ (Mohamed)
print("Hello world \")
Anonymous Quiz
57%
Output => Hello world \
20%
Output => Hello world
23%
Error
👍4❤3🔥2❤🔥1
Forwarded from TechVerse - تك فِيرس
JSONIX Library
Supports:
• Key-Value
• Hashes
• Collections (Lists/Sets)
Fast • Lightweight • Easy to use
Built for developers who need speed and simplicity.
Github: https://github.com/Mohamed-Abdeen-Z/JSONIX
NuGet: https://www.nuget.org/packages/JSONIX
Note: The first edition, under development
-- 🔗 Mohamed Abdeen.
A powerful In-Memory Data Store for C# developers
Supports:
• Key-Value
• Hashes
• Collections (Lists/Sets)
Fast • Lightweight • Easy to use
Built for developers who need speed and simplicity.
Github: https://github.com/Mohamed-Abdeen-Z/JSONIX
NuGet: https://www.nuget.org/packages/JSONIX
Note: The first edition, under development
-- 🔗 Mohamed Abdeen.
❤1
ضفت جروب للمناقشة
added a group for discussion
added a group for discussion
❤4