Python Forum
Basic Python Program for Sequence
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Basic Python Program for Sequence
#4
>>> sequence = int(input("gimme some numbers! "))
gimme some numbers! 2345 3532 3432 4,345 123
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ValueError: invalid literal for int() with base 10: '2345 3532 3432 4,345 123'
Ok, so you can't call int() on a sequence of numbers. So either int(input()) is not what you want, or you want to do it over and over and only ask for one number at a time.
Reply


Messages In This Thread
Basic Python Program for Sequence - by patycanes - Mar-21-2017, 05:53 PM
RE: Basic Python Program for Sequence - by Larz60+ - Mar-21-2017, 05:57 PM
RE: Basic Python Program for Sequence - by nilamo - Mar-21-2017, 09:20 PM
RE: Basic Python Program for Sequence - by wavic - Mar-21-2017, 09:40 PM
RE: Basic Python Program for Sequence - by Larz60+ - Mar-22-2017, 01:04 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Basic program balajee 2 2,807 Sep-11-2018, 07:19 PM
Last Post: gruntfutuk
  python!TypeError: can't multiply sequence by non-int of type 'float' shaywune 2 9,684 Sep-24-2016, 04:33 PM
Last Post: shaywune

Forum Jump:

User Panel Messages

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