1 / 8

First Program

First Program. Open a new Python File Write down the following command : print(“ Hello World ”) Go to Run -> Run As -> Python See the end result. Don’t forget the () and the “ “. This will print a phrase. First Program. Open a new Python File Write down :

leif
Download Presentation

First Program

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. FirstProgram • Open a newPython File • Writedownthefollowingcommand: print(“HelloWorld”) • Go to Run -> Run As -> Python • Seetheendresult Don’tforgetthe() andthe “ “ Thiswill print a phrase

  2. FirstProgram • Open a newPython File • Writedown: print(“HelloWorld”) • Go to Run -> Run As -> Python • Seetheendresult Console: Hello Word

  3. FirstProgram Wewillget: Ifwewrite: print (“HelloWorld”) print (“Helloyear ” +10) Print(“ ThisisPeriod 1”) HelloWorld Helloyear 10 ThisisPeriod 1

  4. Comments Commentsallowyou to writedownthingsthatwillnotbereadbythecompiler. To writecomments: #thisis a onelinecomment “””thisis ablock comment “”

  5. Comments Begineveryprogramwith a commentlikethis “”” Authorofprogram Date Version Explanationofthecode in this file does “””

  6. GoodPractices • Alwaysstart a programwith a commentstatinghowyou are, the date, theversion, andwhatit does • Neverput “;” attheendof a command • Neverhave more than a command in a line • Haveblankspacesbetweendifferntlinesofcode • Commentwhatdifficultpartsofcode do • Save as often as possbible • Thinkbeforewritingthecode. - Alwayshave a pieceofpaperand a pencil to doodlestuff!!!!

  7. BadPractices GoodPractices print (“HelloWorld”) print (“HelloWorld”) print (“HelloWorld”) print (“HelloWorld”) print (“Helloyear ” +10) Print(“ ThisisPeriod 1”) print (“HelloWorld”)print (“HelloWorld”)print (“HelloWorld”)print (“HelloWorld”)print (“Helloyear ” +10)Print(“ ThisisPeriod 1”)

More Related