slide1
Download
Skip this Video
Download Presentation
First Program

Loading in 2 Seconds...

play fullscreen
1 / 8

First Program - PowerPoint PPT Presentation


  • 57 Views
  • Uploaded on

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 :

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about ' First Program' - leif


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

ad