

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
20 questions
STAAR Review Quiz #3
Quiz
•
8th Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
6 questions
Marshmallow Farm Quiz
Quiz
•
2nd - 5th Grade
20 questions
Main Idea and Details
Quiz
•
5th Grade
20 questions
Context Clues
Quiz
•
6th Grade
20 questions
Inferences
Quiz
•
4th Grade
19 questions
Classifying Quadrilaterals
Quiz
•
3rd Grade
12 questions
What makes Nebraska's government unique?
Quiz
•
4th - 5th Grade
Discover more resources for Computers
31 questions
Easter Trivia
Quiz
•
KG - 12th Grade
20 questions
Capitalization in sentences
Quiz
•
KG - 4th Grade
10 questions
GMAS ELA Review
Quiz
•
KG - University
10 questions
How to Catch a Dinosaur
Quiz
•
KG - 5th Grade
10 questions
2D and 3D Shapes Review
Presentation
•
KG - 3rd Grade
20 questions
Place Value
Quiz
•
KG - 3rd Grade
26 questions
Customary Measurement
Quiz
•
KG - University
10 questions
Kindergarten Count to 100
Quiz
•
KG