AZ Crafted CodeSphere: The Innovation Nexus

AZ Crafted CodeSphere: The Innovation Nexus كل ما يتعلق بالتكنولوجيا من برامج وبرمجة
The technology, software , programming

18/07/2025

طريقة اخري لاختيار اسم عشوائي عليه العشاء
import random
names=[]
print("welcome to 'whose wallet?'")
print("you will give me a list of names, and i will pick aperson to pay")
names=input("if you are ready, enter the names separated by a comma:").split(", ")
print(f"please ask'{random.choice(names)}'to take his wallet out.Dinner is on him ")

Send a message to learn more

18/07/2025

اختيار عشوائي لاسم عليه العشاء
import random
names=[]
print("welcome to 'whose wallet?'")
print("you will give me a list of names, and i will pick aperson to pay")
user_names=input("if you are ready, enter the names separated by a comma:")
names=user_names.split(", ")
count_name=len(names)
select_name=names[random.randint(0,count_name-1)]
print(f"please ask'{select_name}'to take his wallet out.Dinner is on him ")

Send a message to learn more

18/07/2025

طريقة اخري لانشاء مكتبه علي بايثون
your_library=[]
your_wishlist=[]

own_book=input("enter the name of a book you own:")
your_library.append(own_book)

another_own_book=input("enter the name of another book you own or press 'enter' to skip:")
if another_own_book:
your_library.append(another_own_book)
print(f"your_library:{your_library}")
else:
print(f"your_library:{your_library}")

wish_book=input("enter the name of a book you wish to have in the future: ")
your_wishlist.append(wish_book)

another_wish_book=input("enter the name of another book you wish to have in the future or press 'enter' to skip: ")
if another_wish_book:
your_wishlist.append(another_wish_book)
print(f"your_wishlist:{your_wishlist}")
else:
print(f"your_wishlist:{your_wishlist}")

acquired_wish_book=input("enter the name of a book from your wishlist that you have acquired:")
if acquired_wish_book in your_wishlist:
your_wishlist.remove(acquired_wish_book)
your_library.append(acquired_wish_book)
print(f"updated_library:{your_library}")
print(f"updated_wishlist:{your_wishlist}")
else:
print(f"updated_library:{your_library}")
print(f"updated_wishlist:{your_wishlist}")

donate_book=input("enter the name of a book from your library you wish to donate or press 'enter' to skip:")
if donate_book in your_library:
your_library.remove(donate_book)
print(f"finaly library after donation:{your_library}")
else:
print(f"finaly library after donation:{your_library}")

Send a message to learn more

18/07/2025

مشروع انشاء مكتبه علي لغة بايثون
your_library = []
your_wishlist = []

# إدخال كتب المكتبة
own_book = input("Enter the name of a book you own: ")
your_library.append(own_book)

another_own_book = input("Enter the name of another book you own or press 'enter' to skip: ")
if another_own_book:
your_library.append(another_own_book)

# إدخال كتب الأمنيات
wish_book = input("Enter the name of a book you wish to have in the future: ")
your_wishlist.append(wish_book)

another_wish_book = input("Enter the name of another book you wish to have in the future or press 'enter' to skip: ")
if another_wish_book:
your_wishlist.append(another_wish_book)

# اكتساب كتاب من الأمنيات
acquired_wish_book = input("Enter the name of a book from your wishlist that you have acquired: ")
if acquired_wish_book in your_wishlist:
your_wishlist.remove(acquired_wish_book)
your_library.append(acquired_wish_book)
print(f"'{acquired_wish_book}' has been moved from wishlist to your library.")
else:
print(f"The book '{acquired_wish_book}' is not in your wishlist.")

# التبرع بكتاب
donate_book = input("Enter the name of a book from your library you wish to donate or press 'enter' to skip: ")
if donate_book in your_library:
your_library.remove(donate_book)
print(f"You have donated '{donate_book}'.")
elif donate_book:
print(f"The book '{donate_book}' is not in your library.")

# الطباعة النهائية
print("\n📚 Final state:")
print(f"Your library: {your_library}")
print(f"Your wishlist: {your_wishlist}")

Send a message to learn more

Address

القاهرة
Cairo

Website

Alerts

Be the first to know and let us send you an email when AZ Crafted CodeSphere: The Innovation Nexus posts news and promotions. Your email address will not be used for any other purpose, and you can unsubscribe at any time.

Shortcuts

Share