https://imgur.com/a/TAarvQQ
^I've attached the image above, program when it runs is on the left. Any help would be appreciated
^I've attached the image above, program when it runs is on the left. Any help would be appreciated
Can't get defined random integer to print properly?
|
https://imgur.com/a/TAarvQQ
^I've attached the image above, program when it runs is on the left. Any help would be appreciated
Aug-29-2018, 10:15 AM
(This post was last modified: Aug-29-2018, 10:15 AM by vndywarhol.)
import random print("Welcome!") def diceroll(): return random.randint(1, 6) print(diceroll())Now this works. You did not return anything. |
|
Possibly Related Threads… | |||||
Thread | Author | Replies | Views | Last Post | |
How to print the output of a defined function | bshoushtarian | 4 | 1,409 |
Sep-08-2022, 01:44 PM Last Post: deanhystad |
|
python library not defined in user defined function | johnEmScott | 2 | 3,982 |
May-30-2020, 04:14 AM Last Post: DT2000 |
|
Call to a print in a defined function | leodavinci1990 | 1 | 1,948 |
Nov-20-2019, 01:45 AM Last Post: ichabod801 |
|
Beginner at Python. Trying to count certain integer from random string of code | kiaspelleditwrong | 3 | 2,512 |
Oct-14-2019, 10:40 AM Last Post: perfringo |
|
Print random musik to wav file | Pereskia | 2 | 2,743 |
Mar-27-2019, 11:53 AM Last Post: Pereskia |
|
How to get a random item from a list, print it and delete it? | giorgosmarga | 3 | 2,674 |
Feb-22-2019, 05:33 PM Last Post: Yoriz |
|
20 x 20 Integer array with random numbers | harryk | 3 | 3,454 |
Jul-28-2018, 03:38 PM Last Post: harryk |
|
How to print a global dictionary class properly | 3dimensions | 2 | 3,298 |
Apr-18-2018, 05:45 PM Last Post: nilamo |