Python - Generate a Random Number Tutorial

preview_player
Показать описание
Learn how to generate a random number in Python.
Рекомендации по теме
Комментарии
Автор

Beautiful. Straight to the point and exactly on point!

willingwinning
Автор

You're an angel I was losing my mind

hannahferguson
Автор

Thanks this helped a lot
Very smooth and clear tutorial

playable
Автор

i made (and am going to make) sooo much using this thank you!🙂

andreischannel
Автор

great when i did the tutoral the random number was <module 'random' from 'C:\\Users\\my

(edit) nvm i was being dumb but every time i do the thing it always says five and never changes

elizabethm
Автор

Please can someone help me in this?

import random
import time



print("Welcome in random number generator!")



time.sleep(1)



liczba = input('what is the lowest number? - ')



liczba2 = input("what is the highest number? - ")



number = random.randint(liczba, liczba2)



print("from ", liczba, " to ", liczba2, )



print("the random number is - ", number)

the prombles is simple
it isn't showing me the random number
it's just ending without showing me the number
"liczba" it's number in polish

foxfor
Автор

i didnt know there is a library for random numbers, i tried to code it from zero.

mruniverse
Автор

Geek tutorials. if you could I really need help with some coding on VB and I can't find much help anywhere. I have this menu and each item has an "order now" button and I want it so when someone clicks the button it will send a message to a new form saying the item they ordered and its price. example: clicked an order button for $1 water and it will pop into a receipt showing the name and price. It would be a huge help for me if there is a video before the end of this week. You've actually inspired me to code and learn new things. please keep up the amazing work and I hope I am not asking for too much

Snrlax
Автор

can i create random number from 0000 ~ 9999
i tried to random it it still random out 3 digit number, i want it random out always 4 digit like 0000 or 0001 as well, how?

yuujilee
Автор

thanks mate.. I wanted to program a monty hall problem

rainabanana
Автор

How can I get it to print out 3 random numbers between 1 and 10?

Cam-Cam-
Автор

I had to look this up as I was frustrated that it was not working.. eventually realising that I had just bad luck getting the number 1 5 times in a row.. It was only 1-5 but this still annoying.

brendan
Автор

Whenever I try this, it gives me the same number over and over again. Is there a solution?

noisnecsa
Автор

How do I add the 2 random numbers that got generated

xsawma
Автор

How can I make the random number into two decimal places? Like 8.00 or 5.00

IchebiChristian
Автор

Thanks mate. My problem lays where my random <= and >= has not been accounted for

harryroberts
Автор

How to do it without chea... I mean without random?

johnyf.q.
Автор

i know im quite late, but when i run my code it says there's an error, and its likely due to a circular import, so im guessing it has to do with the "import random" in the beggining of the code. Any tips?

pedroalmeida
Автор

What if I want it to be a %? Like 1% or 10%?

mrzuzude
Автор

I tried importing the random module in vs code and it did not recognize the file. any way to fix it?

jimmyroy
join shbcf.ru