First program
This presentation is the property of its rightful owner.
Sponsored Links
1 / 8

First Program PowerPoint PPT Presentation


  • 35 Views
  • Uploaded on
  • Presentation posted in: General

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 :

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.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -

Presentation Transcript


First program

FirstProgram

  • Open a newPython File

  • Writedownthefollowingcommand:

    print(“HelloWorld”)

  • Go to Run -> Run As -> Python

  • Seetheendresult

Don’tforgetthe() andthe “ “

Thiswill print a phrase


First program1

FirstProgram

  • Open a newPython File

  • Writedown:

    print(“HelloWorld”)

  • Go to Run -> Run As -> Python

  • Seetheendresult

Console:

Hello Word


First program2

FirstProgram

Wewillget:

Ifwewrite:

print (“HelloWorld”)

print (“Helloyear ” +10)

Print(“ ThisisPeriod 1”)

HelloWorld

Helloyear 10

ThisisPeriod 1


Comments

Comments

Commentsallowyou to writedownthingsthatwillnotbereadbythecompiler.

To writecomments:

#thisis a onelinecomment

“””thisis

ablock

comment

“”


Comments1

Comments

Begineveryprogramwith a commentlikethis

“””

Authorofprogram

Date

Version

Explanationofthecode in this file does

“””


Good practices

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!!!!


Good practices1

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”)


  • Login