

random library
Presentation
•
Computers
•
KG
•
Practice Problem
•
Medium
sadiq sadiq
Used 7+ times
FREE Resource
7 Slides • 6 Questions
1
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 ضمن الخيارات
8
لختيار عدد عشوائي صحيح دبدايته ّ ضمن مجال تحد ونهايته وخطوته. مثال
import random
x= random.randrange(5, 15, 2) print(x)
مجال الارقام العشوائية
5 -7 -9- 11 -13
15 لن يكونضمن األرقام العشوائية
9
Open Ended
اكتب برنامج بلغة بايثون لاختيار عدد عشوائي صحيح
مجال الاعداد العشوائية
البداية 5
النهاية 50
الخطوة 5
10
Open Ended
اكتب برنامج بلغة بايثون لاختيار عدد عشوائي زوجي
مجال الاعداد العشوائية
البداية 2
النهاية 20
11
Fill in the Blanks
import random
n=8
x= random.randrange(n)
print(x)
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
Show answer
Auto Play
Slide 1 / 13
SLIDE
Similar Resources on Wayground
9 questions
CSD Unit 3 - Lesson 24 Functions Part 1
Presentation
•
6th - 8th Grade
11 questions
5 Elements of Game Design
Presentation
•
7th Grade
7 questions
Computer Science 1
Presentation
•
6th - 8th Grade
7 questions
Central Idea and Supporting Details
Presentation
•
6th Grade
13 questions
Data Collection Methods
Presentation
•
12th Grade
6 questions
ΜΗΧΑΝΕΣ ΑΝΑΖΗΤΗΣΗΣ - ΠΩΣ ΛΕΙΤΟΥΡΓΟΥΝ
Presentation
•
10th Grade
11 questions
Elements & Principles of Design
Presentation
•
9th - 12th Grade
9 questions
HARDWARE KOMPUTER
Presentation
•
5th Grade
Popular Resources on Wayground
10 questions
Safety Day 2026 – Student Review
Quiz
•
9th Grade
21 questions
Continents and Oceans
Quiz
•
6th Grade
20 questions
Parts of Speech
Quiz
•
5th Grade
16 questions
Subject & Predicate
Quiz
•
5th Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
12 questions
Map Skills
Quiz
•
3rd Grade
22 questions
Continents and Oceans
Quiz
•
5th Grade
15 questions
Rounding Decimals
Quiz
•
5th Grade
Discover more resources for Computers
26 questions
SLIME!!!!!
Quiz
•
KG - 12th Grade
20 questions
Place Value
Quiz
•
KG - 3rd Grade
4 questions
K-2 Force and Motion Lesson
Presentation
•
KG - 2nd Grade
12 questions
Tone and Mood
Presentation
•
KG
10 questions
Day and Night Patterns
Quiz
•
KG
20 questions
Disney Characters
Quiz
•
KG
12 questions
Nouns and Verbs
Quiz
•
KG - 2nd Grade
15 questions
Short Vowels
Quiz
•
KG - 2nd Grade