1.3. The Python Programming Language — Foundations of Python Programming (2024)

The programming language you will be learning is Python. Python is an exampleof a high-level language; other high-level languages you might have heardof are C++, PHP, and Java.

As you might infer from the name high-level language, there are alsolow-level languages, sometimes referred to as machine languages or assemblylanguages. Loosely speaking, computers can only execute programs written inlow-level languages. Thus, programs written in a high-level language have to beprocessed before they can run. This extra processing takes some time, which isa small disadvantage of high-level languages.However, the advantages to high-level languages are enormous.

First, it is much easier to program in ahigh-level language. Programs written in a high-level language take less timeto write, they are shorter and easier to read, and they are more likely to becorrect. Second, high-level languages are portable, meaning that they canrun on different kinds of computers with few or no modifications. Low-levelprograms can run on only one kind of computer and have to be rewritten to runon another.

Due to these advantages, almost all programs are written in high-levellanguages. Low-level languages are used only for a few specializedapplications.

Two kinds of programs process high-level languages into low-level languages:interpreters and compilers. An interpreter reads a high-level programand executes it, meaning that it does what the program says. It processes theprogram a little at a time, alternately reading lines and performingcomputations.

1.3. The Python Programming Language — Foundations of Python Programming (1)

A compiler reads the program and translates it completely before the programstarts running. In this case, the high-level program is called the sourcecode, and the translated program is called the object code or theexecutable. Once a program is compiled, you can execute it repeatedlywithout further translation.

1.3. The Python Programming Language — Foundations of Python Programming (2)

Many modern languages use both processes. They are first compiled into a lowerlevel language, called byte code, and then interpreted by a program calleda virtual machine. Python uses both processes, but because of the wayprogrammers interact with it, it is usually considered an interpreted language.

For the core material in this book, you will not need to installor run python natively on your computer. Instead, you’ll be writing simpleprograms and executing them right in your browser.

At some point, you will find it useful to have a complete python environment, rather than the limited environmentavailable in this online textbook. To do that, you will eitherinstall python on your computer so that it can run natively, or use a remote server that provides either acommand line shell or a jupyter notebook environment.

Check your understanding

    Source code is another name for:

  • the instructions in a program, written in a high-level language.
  • If the instructions are strored in a file, it is called the source code file.
  • the language that you are programming in (e.g., Python).
  • This language is simply called the programming language, or simply the language. Programs are writte in this language.
  • the environment/tool in which you are programming.
  • The environment may be called the IDE, or integrated development environment, though not always.
  • the number (or “code”) that you must input at the top of each program to tell the computer how to execute your program.
  • There is no such number that you must type in at the start of your program.

    What is the difference between a high-level programming language and a low-level programming language?

  • It is high-level if you are standing and low-level if you are sitting.
  • In this case high and low have nothing to do with altitude.
  • It is high-level if you are programming for a computer and low-level if you are programming for a phone or mobile device.
  • High and low have nothing to do with the type of device you are programming for. Instead, look at what it takes to run the program written in the language.
  • It is high-level if the program must be processed before it can run, and low-level if the computer can execute it without additional processing.
  • Python is a high level language but must be interpreted into machine code (binary) before it can be executed.
  • It is high-level if it easy to program in and is very short; it is low-level if it is really hard to program in and the programs are really long.
  • While it is true that it is generally easier to program in a high-level language and programs written in a high-level language are usually shorter, this is not always the case.

    Pick the best replacements for 1 and 2 in the following sentence: When comparing compilers and interpreters, a compiler is like 1 while an interpreter is like 2.

  • 1 = a process, 2 = a function
  • Compiling is a software process, and running the interpreter is invoking a function, but how is a process different than a function?
  • 1 = translating an entire book, 2 = translating a line at a time
  • Compilers take the entire source code and produce object code or the executable and interpreters execute the code line by line.
  • 1 = software, 2 = hardware
  • Both compilers and interpreters are software.
  • 1 = object code, 2 = byte code
  • Compilers can produce object code or byte code depending on the language. An interpreter produces neither.

You have attempted of activities on this page

1.3. The Python Programming Language — Foundations of Python Programming (2024)
Top Articles
How Can You Tell if Your Paintballs Are Still Good to Use
What Will Happen If My SSL Certificate Expires?
Best Pizza Novato
Washu Parking
Coffman Memorial Union | U of M Bookstores
Gw2 Legendary Amulet
THE 10 BEST River Retreats for 2024/2025
Which aspects are important in sales |#1 Prospection
[2024] How to watch Sound of Freedom on Hulu
William Spencer Funeral Home Portland Indiana
Detroit Lions 50 50
Non Sequitur
iOS 18 Hadir, Tapi Mana Fitur AI Apple?
Hell's Kitchen Valley Center Photos Menu
Swgoh Blind Characters
Quick Answer: When Is The Zellwood Corn Festival - BikeHike
Rufus Benton "Bent" Moulds Jr. Obituary 2024 - Webb & Stephens Funeral Homes
PCM.daily - Discussion Forum: Classique du Grand Duché
Watch Your Lie in April English Sub/Dub online Free on HiAnime.to
Cookie Clicker Advanced Method Unblocked
Integer Division Matlab
2487872771
Gma' Deals & Steals Today
Gunsmoke Tv Series Wiki
Xxn Abbreviation List 2023
The Creator Showtimes Near Baxter Avenue Theatres
Craigslist Middletown Ohio
Moonrise Time Tonight Near Me
Mobile Maher Terminal
Sun-Tattler from Hollywood, Florida
Breckie Hill Fapello
Vitals, jeden Tag besser | Vitals Nahrungsergänzungsmittel
The Blackening Showtimes Near Regal Edwards Santa Maria & Rpx
Honda Ruckus Fuse Box Diagram
Restored Republic December 9 2022
Planet Fitness Lebanon Nh
Www Craigslist Com Brooklyn
Publictributes
Wo ein Pfand ist, ist auch Einweg
Gary Lezak Annual Salary
Qlima© Petroleumofen Elektronischer Laserofen SRE 9046 TC mit 4,7 KW CO2 Wächter • EUR 425,95
Grizzly Expiration Date Chart 2023
Martha's Vineyard – Travel guide at Wikivoyage
Craigslist Binghamton Cars And Trucks By Owner
Spn 3464 Engine Throttle Actuator 1 Control Command
Cryptoquote Solver For Today
Convert Celsius to Kelvin
Provincial Freeman (Toronto and Chatham, ON: Mary Ann Shadd Cary (October 9, 1823 – June 5, 1893)), November 3, 1855, p. 1
Skybird_06
Turning Obsidian into My Perfect Writing App – The Sweet Setup
Latest Posts
Article information

Author: Pres. Carey Rath

Last Updated:

Views: 6069

Rating: 4 / 5 (61 voted)

Reviews: 84% of readers found this page helpful

Author information

Name: Pres. Carey Rath

Birthday: 1997-03-06

Address: 14955 Ledner Trail, East Rodrickfort, NE 85127-8369

Phone: +18682428114917

Job: National Technology Representative

Hobby: Sand art, Drama, Web surfing, Cycling, Brazilian jiu-jitsu, Leather crafting, Creative writing

Introduction: My name is Pres. Carey Rath, I am a faithful, funny, vast, joyous, lively, brave, glamorous person who loves writing and wants to share my knowledge and understanding with you.