

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
10 questions
Saving your file to one drive
Presentation
•
KG - 12th Grade
9 questions
Ms. Tewodros random Quizizz!
Presentation
•
6th - 7th Grade
11 questions
Komponen - Komponen Komputer
Presentation
•
10th Grade
7 questions
Знаходження мінімального та максимального значення списку
Presentation
•
9th Grade
7 questions
Sistem Komputer
Presentation
•
10th Grade
9 questions
STATISTICS AND PROBABILITY RANDOM VARIABLES
Presentation
•
11th Grade
10 questions
Summarizing
Presentation
•
9th - 12th Grade
11 questions
Evolution & Natural Selection
Presentation
•
9th - 10th Grade
Popular Resources on Wayground
20 questions
Math Review
Quiz
•
3rd Grade
15 questions
Fast food
Quiz
•
7th Grade
20 questions
Context Clues
Quiz
•
6th Grade
20 questions
Inferences
Quiz
•
4th Grade
19 questions
Classifying Quadrilaterals
Quiz
•
3rd Grade
20 questions
Figurative Language Review
Quiz
•
6th Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
10 questions
Identify Fractions, Mixed Numbers & Improper Fractions
Quiz
•
3rd - 4th Grade
Discover more resources for Computers
20 questions
Cartoon Characters!
Quiz
•
KG - 5th Grade
10 questions
Movie Trivia
Quiz
•
KG - 2nd Grade
15 questions
Memorial Day Trivia
Quiz
•
KG - 12th Grade
12 questions
Name that Candy
Quiz
•
KG - 12th Grade
20 questions
Guess The App
Quiz
•
KG - Professional Dev...
20 questions
Guess that Disney
Quiz
•
KG - 5th Grade
16 questions
cartoons
Quiz
•
KG - 6th Grade
16 questions
Fun Fun Fun Fun!!!!!!!!!!!!!!
Quiz
•
KG - 5th Grade