Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
question about Python
#1
If someone could answer this, that would be great!

My question concerns this video called
"Python Programming Tutorial - 3: Comments in Python:"
https://www.youtube.com/watch?v=Uu7C99-hG60

When I put in print "Hello World!" and hit return, it prints out Hello World! It doesn't give me a chance to put in print "What's up?" and print out both sayings. Instead, it just prints What's up? after I type in print "What's up?"

I can't get in touch with the person who made the YouTube video, someone called "The Bad Tutorials."

Thanks
Reply
#2
IDLE outputs the program output and the Pytohn interpreter indicated by the >>> on the same. He is useing a script and running hte script. I am assuming you are using the >>>

There are multiple ways to execute python and you both are using different methods
read up on this
https://python-forum.io/Thread-Basic-How...ython-code
Recommended Tutorials:
Reply
#3
From your description, it sounds you're typing in an interactive terminal. If you put the print statements in a file (e.g., hello.py) and run the file from a command prompt (python.exe hello.py), it will print out both things. (The executable name will depend on what version of python you have installed and what system (Windows, Mac, Linux) you're working with.)
Reply
#4
also, when put in a file, be sure not to type the '>>>' as that is just the interactive prompt.
Reply


Forum Jump:

User Panel Messages

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