آموزش پایتون | هوش مصنوعی | voidcompile
5.93K subscribers
246 photos
48 files
58 links
یادگیری برنامه نویسی، هوش مصنوعی، دیتا ساینس و پروژه‌های تحقیقاتی

Python | Machine Learning | Biopython | AI

مطالب آموزشی ، تحقیقاتی ، پروژه محور و پژوهشی برای
علاقه مندان به یادگیری برنامه نویسی
Download Telegram
آموزش پایتون | هوش مصنوعی | voidcompile
Photo
🎲 آموزش شبیه‌ سازی پرتاب تاس در پایتون – پروژه‌ای ساده و جذاب برای مبتدی‌ها!
در این آموزش یاد می‌گیری چطور با استفاده از توابع random، حلقه while و ورودی کاربر، یک تاس ۶ وجهی رو شبیه‌سازی کنی.
اگه تازه وارد دنیای برنامه‌نویسی پایتون شدی، این پروژه یه شروع عالیه!
👇 کدش اینجاست، تستش کن و نتیجه رو ببین.

import random  # Import the random module to generate random numbers

print("Press Enter to roll the dice (type 'q' to quit):")

while True:
user_input = input("> ") # Wait for user input
if user_input.lower() == 'q': # If the user types 'q', exit the loop
print("Exiting the program. Goodbye!")
break
dice_roll = random.randint(1, 6) # Generate a random number between 1 and 6
print(f"🎲 You rolled: {dice_roll}") # Display the result

ری اکشن یادتون نره رفقا حمایت شما انگیزه ما برای ادامه دادنه

#LearnPython@voidcompile
#LearnPython15@voidcompile
💻@voidcompile
💯42👍34🔥3229🏆22