Python Forum
different programming languages/words in text editors
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
different programming languages/words in text editors
#7
(Jul-04-2021, 05:15 PM)alok Wrote: Thank You,as I said and from what you gave as demo ,to do the same function like Hello World , in Python , C++ or JavaScript, the three all use different code to produce the same outcome,correct ?
If I am correct ,why was this done this way ?
Yes the produce the same output,but the usage languages can different task as eg JavaScript run mostly in Browser.
(Jul-04-2021, 05:15 PM)alok Wrote: A person that learns say Python and knows nothing else would not be able to program with say JavaScript until he or she learned JavaScript ,correct ?
If know Python then JavaScript is similar is not that big a difference.
If i just copy some JavaScript code from web.
function returnSum(first, second)
        {
          var sum = first + second;
          return sum;
        }
      var firstNo = 78;
      var secondNo = 22;
      console.log(firstNo + " + " + secondNo + " = " + returnSum(firstNo,secondNo));
Output:
78 + 22 = 100
Can easily write this in Python.
def return_sum(first, second):
    mysum = first + second
    return mysum

firstNo = 78
secondNo = 22
print(f'{firstNo} + {secondNo} = {return_sum(firstNo, secondNo)}')
Output:
78 + 22 = 100
So the output is the same.
JavaScript is popular for web-development as together with HTML/CSS it can use Brower for output.
So different langue can have different usage even it outcome is the same.
Reply


Messages In This Thread
RE: different programming languages/words in text editors - by snippsat - Jul-05-2021, 12:30 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Python vs low level languages, (say C++) astral_travel 1 358 Apr-07-2024, 01:22 AM
Last Post: PyDan
  Online Python Editors with Built-in Compilers Elon_Warner 0 695 Oct-04-2023, 08:35 PM
Last Post: Elon_Warner
  what stand-alone python-aware open-source editors are around? Skaperen 14 2,266 Jun-11-2023, 11:12 PM
Last Post: Skaperen
  Stanza: A Python NLP Library for Many Human Languages, by the Stanford NLP Group buran 0 1,813 Mar-26-2020, 05:36 PM
Last Post: buran
  Python editors srm 2 2,231 Mar-03-2020, 10:28 AM
Last Post: snippsat
  text editors with Python Skaperen 4 152,112 Dec-02-2019, 08:16 PM
Last Post: Larz60+
  Suggestions for a machine learning model for invoice processing multiple languages? animeshsarraf 1 2,192 May-26-2019, 04:43 AM
Last Post: heiner55
  Text Editors! TrueStudentOfPython 7 4,547 Nov-27-2018, 01:26 AM
Last Post: Larz60+
  [split] Python Editors Wiki Updates metulburr 0 2,599 Nov-09-2017, 06:47 PM
Last Post: metulburr
  configuration formats / languages Skaperen 24 11,845 Oct-17-2017, 02:08 AM
Last Post: Skaperen

Forum Jump:

User Panel Messages

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