

random library
Presentation
•
Computers
•
KG
•
Practice Problem
•
Medium
sadiq sadiq
Used 7+ times
FREE Resource
7 Slides • 6 Questions
1
المكتبة العشوائية Random
2
استدعاء المكتبة العشوائية
يمكن استدعاء المكتبة الخاصة بتوليد الارقام العشوائية باستخدام الكود التالي
import random
3
تقوم بتوليد عدد عشوائي صحيح مع تحديد مجال .البداية والنهاية
يتضمن العدد الاول والاخير
randint()
تقوم هذه الدالة بتوليد رقم عشوائي بين
العدد0
والعدد1
بحيث لايكون العدد واحد ضمن الخيارات
0.999 or 0
random()
دوال المكتبة العشوائية
randrange()
تقوم بتوليد عدد عشوائي
صحيح ضمن مجال محدد
وهو لا يتضمن العدد الاخير ضمن الخيارات
4
random()
import random
x=random.random()
print(x)
الاجابات المتوقعه تتراوح بين العدد 0
والعدد 0.999
5
Multiple Choice
import random
x=random.random()
print(x)
ناتج الكود السابق هو
1
0.7
12
1.2
6
randint()
import random
x= random.randint(10, 15)
print(x)
10 - 11 - 12 -13 - 14 - 15 الارقام العشوائية الممكنة
الخيارات تتضمن العدد الاول والعدد الاخير
7
import random
x= random.randrange(5, 11) print(x)
مجال الارقام العشوائية
5 -6 -7 -8 -9 -10
11 لن يكون ضمن الارقام العشوائية
import random
x= random.randrange(8) print(x)
مجال الارقام العشوائية
0 - 1 - 2 - 3 - 4 - 5 - 6 -7
لن يكون 8 ضمن الخيارات
randrange()
8
لختيار عدد عشوائي صحيح دبدايته ّ ضمن مجال تحد ونهايته وخطوته. مثال
import random
x= random.randrange(5, 15, 2) print(x)
مجال الارقام العشوائية
5 -7 -9- 11 -13
15 لن يكونضمن األرقام العشوائية
randrange()
9
Open Ended
اكتب برنامج بلغة بايثون لاختيار عدد عشوائي صحيح
مجال الاعداد العشوائية
البداية 5
النهاية 50
الخطوة 5
10
Open Ended
اكتب برنامج بلغة بايثون لاختيار عدد عشوائي زوجي
مجال الاعداد العشوائية
البداية 2
النهاية 20
11
Fill in the Blanks
12
Multiple Choice
import random
x= random.randrange(5,10,2)
print(x)
5-7-9
5-6-7-8-9-10
5-10
5-7-9-11
13
Match
وصل كل رقم بالدالة المناسبة
random.randint(4,10)
random.random()
random.randrange(8)
9
0.2
4
9
0.2
4
المكتبة العشوائية Random
Show answer
Auto Play
Slide 1 / 13
SLIDE
Similar Resources on Wayground
8 questions
Lesson1
Presentation
•
6th - 8th Grade
8 questions
Perangkat Keras Komputer
Presentation
•
1st Grade
11 questions
Year 8 Lesson 3 Hardware
Presentation
•
6th - 8th Grade
12 questions
Introduction: Measures of Center ( Mean, Median, and Mode)
Presentation
•
7th Grade
12 questions
Human Biotechnology
Presentation
•
8th Grade
11 questions
Lesson 30 - 31 Review
Presentation
•
7th Grade
10 questions
Unit 7.2 Mechanisms of Evolution Notes
Presentation
•
9th Grade
8 questions
Normal Distribution Curve
Presentation
•
9th Grade - University
Popular Resources on Wayground
11 questions
Hallway & Bathroom Expectations
Quiz
•
6th - 8th Grade
10 questions
HCS SCI 03 Summer School Assessment 2
Quiz
•
3rd Grade
11 questions
Home Scope
Quiz
•
7th - 8th Grade
12 questions
2026 TAP Technology in the Classroom
Presentation
•
Professional Development
15 questions
HCS SCI 05 Summer School Assessment 2 Review
Quiz
•
5th Grade
15 questions
HCS SCI 04 Summer School Review 2
Quiz
•
4th Grade
59 questions
Geometry Unit 3 Review
Quiz
•
9th - 12th Grade
14 questions
FAST ELA READING SMAPLE TEST MATERIALS
Passage
•
3rd Grade