

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
7 questions
Computer
Presentation
•
KG - University
12 questions
Storage
Presentation
•
7th - 9th Grade
12 questions
Aplikasi Pengolah Angka/ Spreadsheet
Presentation
•
12th Grade
12 questions
Powerpoint lesson 4
Presentation
•
KG - 12th Grade
8 questions
Grade 3 Input and output devices
Presentation
•
1st - 5th Grade
11 questions
Probability Independent and Dependent Events
Presentation
•
7th Grade
10 questions
TIK/Informatika
Presentation
•
7th Grade
10 questions
HARDWARE
Presentation
•
1st Grade
Popular Resources on Wayground
6 questions
Secondary Safety Quiz
Presentation
•
9th - 12th Grade
10 questions
MyPath Diagnostic Overview
Presentation
•
6th - 8th Grade
20 questions
Lab Safety Quiz
Quiz
•
6th Grade
21 questions
Continents and Oceans
Quiz
•
6th Grade
20 questions
Adding and Subtracting Decimals
Quiz
•
5th Grade
20 questions
Parts of Speech
Quiz
•
5th Grade
16 questions
Subject & Predicate
Quiz
•
5th Grade
21 questions
Lab Safety
Quiz
•
10th Grade
Discover more resources for Computers
20 questions
Place Value
Quiz
•
KG - 3rd Grade
16 questions
Lab Equipment
Quiz
•
KG
20 questions
Community helpers
Quiz
•
KG - 3rd Grade
15 questions
Subject and Predicate
Quiz
•
KG - 3rd Grade
12 questions
Nouns and Verbs
Quiz
•
KG - 2nd Grade
10 questions
Four Types of Sentences
Quiz
•
KG - 12th Grade
12 questions
Globes and maps
Presentation
•
KG
15 questions
Digraph Practice
Quiz
•
KG