Python Forum
I'm not sure why this code isn't printing... Can someone tell me?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
I'm not sure why this code isn't printing... Can someone tell me?
#5
(Mar-01-2018, 06:42 PM)Wilminer4 Wrote: Oh okay, I'll try that and sorry about using Python 2, I made this at a website called codehs.com because we use it in class. I'm ahead of other people, so I decided to mess around. Thanks for the info I'll try it.

I tried what you said and it didnt't work...

I see what's going on. Try using the raw_input() function instead of input().

From the 2.7 docs:
Quote:input([prompt])
Equivalent to eval(raw_input(prompt)).

This function does not catch user errors. If the input is not syntactically valid, a SyntaxError will be raised. Other exceptions may be raised if there is an error during evaluation.

If the readline module was loaded, then input() will use it to provide elaborate line editing and history features.

Consider using the raw_input() function for general input from users.
Reply


Messages In This Thread
RE: I'm not sure why this code isn't printing... Can someone tell me? - by mpd - Mar-01-2018, 06:54 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Code printing twice hypersdevelopment 3 6,367 Sep-09-2018, 12:06 AM
Last Post: hypersdevelopment

Forum Jump:

User Panel Messages

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