Python Forum
having issues with the int() function
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
having issues with the int() function
#3
If using 3.8 <= Python then it is possible to take advantage of assignment expression (walrus operator) and instead of while True write:

while (answer := input('Enter a number: ')) != 'done':
I'm not 'in'-sane. Indeed, I am so far 'out' of sane that you appear a tiny blip on the distant coast of sanity. Bucky Katt, Get Fuzzy

Da Bishop: There's a dead bishop on the landing. I don't know who keeps bringing them in here. ....but society is to blame.
Reply


Messages In This Thread
having issues with the int() function - by megu - Sep-23-2020, 02:52 PM
RE: having issues with the int() function - by perfringo - Sep-23-2020, 04:28 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Issues with Lambda Function fad3r 5 3,785 May-22-2018, 04:13 PM
Last Post: fad3r

Forum Jump:

User Panel Messages

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