Random Numbers

Buğra Özyurt
May 19, 2021

--

Random Modülü:

Belirli bir aralıkta rastgele sayıların üretilmesinde Python’ın standart kütüphanesinde bulunan random adlı bir modülü kullanabilirsiniz.

Elbette bu modülü kullanabilmek için öncelikle modülümüzü içe aktarmamız gerekiyor:

import random

Bu işlemin ardından, bu modülün bize sunduğu bütün işlevlerden yararlanabiliriz.

random.randint(0,9)  #0-9 arası rastgele bir sayı verir.

Que: Create a list with 5 random integer numbers between 0 to 100.

Game Example: Find the random number given form computer between 0 to 100. In each prediction, computer says the given number is low or high and it counts when you predict the correct value.

Game Example: Bilgisayara tuttuğun sayıyı buldurma oyunu.

Game Example: Bilgisayara tuttuğun sayıyı “ aralık vererek “ buldurma oyunu.

Video:

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

--

--

Buğra Özyurt
Buğra Özyurt

No responses yet

Write a response