Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help with randint/random
#2
You need to include the error message when you get one.

I'm guessing it's because you're using Python 2 examples when you have Python 3 installed. You need to use parenthesis with print, like so:
print(random.randint(0,5))
Reply


Messages In This Thread
Help with randint/random - by Tunechi - May-14-2018, 02:08 AM
RE: Help with randint/random - by micseydel - May-14-2018, 02:23 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  random numbers, randint janeik 2 578 Nov-27-2023, 05:17 PM
Last Post: janeik
  Unexpected output while using random.randint with def terickson2367 1 522 Oct-24-2023, 05:56 AM
Last Post: buran
Sad Iterate randint() multiple times when calling a function Jake123 2 2,067 Feb-15-2022, 10:56 PM
Last Post: deanhystad
  Using Dictionary to Test Evenness of Distribution Generated by Randint Function new_coder_231013 6 3,310 Feb-23-2021, 01:29 PM
Last Post: new_coder_231013
  Help with a random.randint choice in Python booponion 5 2,822 Oct-23-2020, 05:13 PM
Last Post: deanhystad
  Inheriting, given number from randint is not working beLIEve 0 1,526 Oct-12-2019, 06:50 PM
Last Post: beLIEve
  same number everytime when using random.randint summeringpainting 5 8,227 Aug-23-2019, 11:01 AM
Last Post: Malt
  randint stops changing values in a loop Naito 4 3,376 Jan-30-2019, 08:15 AM
Last Post: perfringo

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020