Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Random Choice Operations
#2
Your code is trying to divide the print statement by 2
Error:
TypeError: unsupported operand type(s) for /: 'NoneType' and 'int'
Using f string formating
print(f'result is : {random_num/2}')
Reply


Messages In This Thread
Random Choice Operations - by Souls99 - Jul-31-2020, 08:18 PM
RE: Random Choice Operations - by Yoriz - Jul-31-2020, 08:34 PM
RE: Random Choice Operations - by Souls99 - Jul-31-2020, 09:18 PM
RE: Random Choice Operations - by Yoriz - Jul-31-2020, 09:27 PM
RE: Random Choice Operations - by Souls99 - Jul-31-2020, 09:33 PM
RE: Random Choice Operations - by Yoriz - Jul-31-2020, 09:54 PM
RE: Random Choice Operations - by Souls99 - Jul-31-2020, 10:37 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  combobox_callback(choice choice part of openfile name (kind of dependency) janeik 9 1,697 Sep-10-2023, 10:27 PM
Last Post: janeik
  Replicate Excel operations with Python Lumberjack 3 1,956 May-10-2022, 01:44 AM
Last Post: Lumberjack
  random.choice HELP samuelbachorik 4 2,426 Aug-18-2021, 03:24 PM
Last Post: naughtyCat
  Program demonstrates operations of bitwise operators without using bitwise operations ShawnYang 2 1,902 Aug-18-2021, 03:06 PM
Last Post: deanhystad
  Unable to use random.choice(list) in async method spacedog 4 3,638 Apr-29-2021, 04:08 PM
Last Post: spacedog
  Help with a random.randint choice in Python booponion 5 2,975 Oct-23-2020, 05:13 PM
Last Post: deanhystad
  trying to input a variable using random.choice python63 9 3,866 Aug-13-2020, 05:37 PM
Last Post: python63
  Create bot to automate operations in IQ Option JonatasCavalini 0 13,275 Jul-19-2020, 02:23 AM
Last Post: JonatasCavalini
  Two operations in two ranges salwa17 3 2,314 Jun-22-2020, 04:15 PM
Last Post: perfringo
  random.choice() takes two positional arguments, but three were given. ShakeyPakey 5 12,092 May-31-2020, 03:13 PM
Last Post: deanhystad

Forum Jump:

User Panel Messages

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