Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Variables
#1
Trying to understand why I don't get the result the books says. (Python Crash Course)
message = "Hello Python world!"
print(message)
message = "Hello Python Crash Course World!"
print(message)

In the book the result says
Hello Python world!
Hello Python Crash Course World!

What I am getting is
message = "Hello Python world!"
print(message)
message = "Hello Python Crash Course World!"
print(message)

I am using Microsoft Word pad. I was using Geany 8 months ago and my result was correct. Do I need a program to run variables?
Reply
#2
Code is just text, saved in a plain text file, without formatting. Because of that, Word pad is not a good editor to use: it might add formatting where there shouldn't be any. Notepad++ or Visual Studio Code (or Geany, or any of hundreds of other editors) are fine.

Geany is what's known as an Integrated Development Environment (or IDE). It's called Integrated, because it's a bunch of different, unrelated, tools combined into one coherent whole. Which is how it was able to run your code and show you the output.

Word pad is just an editor. All it does is edit text. Expecting it to do anything other than edit text is madness :p

Python is the program which you should use to run your code and get output. https://docs.python.org/3/using/cmdline....mmand-line
Reply
#3
Is there another way to use python? My screen shows python 3.6. Starting;

Python 3.6.4 (v3.6.4:d48eceb, Dec 19 2017, 06:04:45) [MSC v.1900 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>>

I do not have another way of running variables other than what is posted. I open the program and above is what I see. I also do not know how to use the program. I am a beginner.
Reply
#4
https://python-forum.io/Thread-Basic-How...ython-code
Reply
#5
The link is useful. I don't understand how to make a variable from reading the crash course. Do I type a specific in IDE or IDLE
Reply
#6
(Feb-09-2018, 01:53 AM)Demini Wrote: The link is useful. I don't understand how to make a variable from reading the crash course. Do I type a specific in IDE or IDLE

You don't need a specific program or IDE to make a variable, a variable is what you define it to be.
Here is a short video on variables in Python, I think it will help you
https://www.youtube.com/watch?v=BAoV5_qVKco
Reply


Forum Jump:

User Panel Messages

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