SlideShare una empresa de Scribd logo
1 de 19
ΠΕΡΙΓΡΑΦΗ ΓΛΩΣΣΑΣ
PYTHON part1
ΠΛΕΟΝΕΚΤΗΜΑΤΑ
 ΑΠΛΗ
 ΕΥΚΟΛΗ ΣΤΗ ΜΑΘΗΣΗ
 OPEN SOURCE
 ΥΨΗΛΟΥ ΕΠΙΠΕΔΟΥ(SCRIPT)
 ΑΝΕΞΑΡΤΗΤΗ ΛΕΙΤΟΥΡΓΙΚΟΥ
ΣΥΣΤΗΜΑΤΟΣ
 ΔΙΕΡΜΗΝΕΥΟΜΕΝΗ
 ΑΝΤΙΚΕΙΜΕΝΟΣΤΡΑΦΗΣ
ΒΑΣΙΚΟΙ ΤΥΠΟΙ ΔΕΔΟΜΕΝΩΝ
 ΕΜΜΕΣΗ ΔΗΛΩΣΗ ΜΕΤΑΒΛΗΤΩΝ
 ΜΕΤΑΒΛΗΤΕΣ
 ΑΡΙΘΜΗΤΙΚΕΣ (ΑΚΕΡΑΙΟΙ, ΠΡΑΓΜΑΤΙΚΟΙ,
ΜΙΓΑΔΙΚΟΙ)
 ΑΛΦΑΡΙΘΜΗΤΙΚΕΣ (‘…’, ”…”, ‘’’…’’’, “””…”””)
 ΛΟΓΙΚΕΣ (True, False)
ΒΑΣΙΚΟΙ ΤΥΠΟΙ ΔΕΔΟΜΕΝΩΝ
 ΤΑ ΟΝΟΜΑΤΑ ΤΩΝ ΜΕΤΑΒΛΗΤΩΝ
ΠΕΡΙΕΧΟΥΝ
 ΤΑ ΓΡΑΜΜΑΤΑ ΤΟΥ ΑΓΓΛΙΚΟΥ
ΑΛΦΑΒΗΤΟΥ ( ΠΕΖΑ - ΚΕΦΑΛΑΙΑ )
 ΤΟ ΧΑΡΑΚΤΗΡΑ “ _ “
 ΤΑ ΨΗΦΙΑ 0,1,2,3,4,5,6,7,8,9
 ΤΟ ΟΝΟΜΑ ΠΡΕΠΕΙ ΝΑ ΑΡΧΙΖΕΙ ΜΕ
ΓΡΑΜΜΑ Η΄ “ _ “
ΠΡΑΞΕΙΣ ΜΕ ΜΕΤΑΒΛΗΤΕΣ
 ΑΡΙΘΜΗΤΙΚΕΣ
+, -, *, /, **, //, %, <<, >>
&, |, ^, ~
<, >, ==,<=, >=, !=
 ΑΛΦΑΡΙΘΜΗΤΙΚΕΣ
+
<, >, ==,<=, >=, !=
 ΛΟΓΙΚΕΣ
not, and, or
ΜΟΡΦΗ ΠΡΟΓΡΑΜΜΑΤΟΣ
 ΕΝΤΟΛΕΣ
 ΑΝ ΒΡΙΣΚΟΝΤΑΙ ΣΤΗΝ ΙΔΙΑ ΓΡΑΜΜΗ
ΔΙΑΧΩΡΙΖΟΝΤΑΙ ΜΕ “ ; ”.
 ΑΝ ΒΡΙΣΚΟΝΤΑΙ ΣΕ ΔΙΑΦΟΡΕΤΙΚΗ
ΓΡΑΜΜΗ ΤΟ “ ; ” ΜΠΟΡΕΙ ΝΑ
ΠΑΡΑΛΕΙΦΘΕΙ.
ΜΟΡΦΗ ΠΡΟΓΡΑΜΜΑΤΟΣ
 ΟΙ ΛΕΥΚΟΙ ΧΑΡΑΚΤΗΡΕΣ ( ΚΕΝΑ ΚΑΙ
ΤΑΒ ) ΣΤΗΝ ΑΡΧΗ ΤΩΝ ΓΡΑΜΜΩΝ
ΟΜΑΔΟΠΟΙΟΥΝ ΤΙΣ ΕΝΤΟΛΕΣ ΣΕ
ΟΜΑΔΕΣ ΕΝΤΟΛΩΝ ( ΜΠΛΟΚ ).
 ΤΟ ΣΥΜΒΟΛΟ # ΧΡΗΣΙΜΟΠΟΙΕΙΤΑΙ ΓΙΑ
ΤΗΝ ΕΙΣΑΓΩΓΗ ΣΧΟΛΙΩΝ.
ΕΝΤΟΛΕΣ
 =
 ΑΝΑΘΕΣΗ ΤΙΜΗΣ
 Print
 ΕΜΦΑΝΙΖΕΙ ΣΤΗΝ ΟΘΟΝΗ
 Input
 ΔΙΑΒΑΖΕΙ ΑΠΌ ΤΟ ΠΛΗΚΡΟΛΟΓΙΟ
ΕΝΤΟΛΕΣ
 if συνθήκη :
Μπλοκ εντολών
elif συνθήκη :
Μπλοκ εντολών
else :
Μπλοκ εντολών
ΕΝΤΟΛΕΣ
 while συνθήκη :
Μπλοκ εντολών
else :
Μπλοκ εντολών
ΕΝΤΟΛΕΣ
 for μεταβλητή in λίστα_τιμών :
Μπλοκ εντολών
else :
Μπλοκ εντολών
ΕΝΤΟΛΕΣ
 break
 ΧΡΗΣΙΜΟΠΟΙΕΙΤΑΙ ΓΙΑ ΝΑ ΒΓΟΥΜΕ ΑΠΌ
ΒΡΟΧΟΥΣ for και while.
 continue
 ΧΡΗΣΙΜΟΠΟΙΕΙΤΑΙ ΓΙΑ ΝΑ ΠΑΜΕ ΣΤΗΝ
ΕΠΟΜΕΝΗ ΕΠΑΝΑΛΗΨΗ for Η while.
ΣΥΝΑΡΤΗΣΕΙΣ
 def όνομα_συνάρτησης ( παράμετροι ):
Μπλοκ εντολών
 ΟΙ ΠΑΡΑΜΕΤΡΟΙ ΜΠΟΡΟΥΝ ΚΑΙ ΝΑ ΜΗΝ ΥΠΑΡΧΟΥΝ
 ΑΝ ΤΟ Μπλοκ εντολών ΔΕΝ ΥΠΑΡΧΕΙ ΠΡΕΠΕΙ ΝΑ
ΒΑΛΟΥΜΕ ΤΗΝ ΛΕΞΗ pass
 ΥΠΟΣΤΗΡΙΖΕΤΑΙ ΥΠΕΡΦΟΡΤΩΣΗ ΣΥΝΑΡΤΗΣΕΩΝ
 ΥΠΟΣΤΗΡΙΖΕΤΑΙ ΑΡΧΙΚΟΠΟΙΗΣΗ ΠΑΡΑΜΕΤΡΩΝ
ΣΥΝΑΡΤΗΣΕΙΣ
 ΓΙΑ ΝΑ ΕΠΙΣΤΡΕΨΟΥΜΕ ΜΙΑ ΤΙΜΗ ΑΠΟ
ΣΥΝΑΡΤΗΣΗ ΧΡΗΣΙΜΟΠΟΙΟΥΜΕ ΤΗΝ
ΕΝΤΟΛΗ return.
 ΕΜΦΑΝΙΣΗ ΠΛΗΡΟΦΟΡΙΩΝ ΤΗΣ
ΣΥΝΑΡΤΗΣΗΣ ΓΙΝΕΤΑΙ ΜΕ ΤΟ DocString
ΤΟ ΟΠΟΙΟ ΚΑΘΟΡΙΖΕΙ Ο ΔΗΜΙΟΥΡΓΟΣ
ΤΗΣ ΣΥΝΑΡΤΗΣΗΣ (__doc__)
ΑΡΧΕΙΑ
 ΓΙΑ ΝΑ ΧΡΗΣΙΜΟΠΟΙΗΣΟΥΜΕ ΜΙΑ
ΣΥΝΑΡΤΗΣΗ ‘Η ΜΕΤΑΒΛΗΤΗ ΠΟΥ
ΕΙΝΑΙ ΣΕ ΔΙΑΦΟΡΕΤΙΚΟ ΑΡΧΕΙΟ
 ΚΑΝΟΥΜΕ import ΤΟ ΣΥΓΚΕΚΡΙΜΕΝΟ ΑΡΧΕΙΟ
 ΤΗΝ ΚΑΛΟΥΜΕ ΜΕ ΤΟ
ΟΝΟΜΑ_ΑΡΧΕΙΟΥ.ΟΝΟΜΑ_ΣΥΝΑΡΤΗΣΗΣ
 ΤΟ ΣΥΓΚΕΚΡΙΜΕΝΟ ΑΡΧΕΙΟ ΟΝΟΜΑΖΕΤΑΙ
module
ΔΟΜΕΣ ΔΕΔΟΜΕΝΩΝ
 ΛΙΣΤΕΣ
 ΟΝΟΜΑ_ΛΙΣΤΑΣ = [ ΣΤΟΙΧΕΙΟ_ΛΙΣΤΑΣ1,
ΣΤΟΙΧΕΙΟ_ΛΙΣΤΑΣ2, …
ΣΤΟΙΧΕΙΟ_ΛΙΣΤΑΣΝ, ]
 ΓΙΑ ΝΑ ΑΝΑΦΕΡΘΟΥΜΕ ΣΤΟ i-ΟΣΤΟ
ΣΤΟΙΧΕΙΟ ΤΗΣ ΛΙΣΤΑΣ :
 ΟΝΟΜΑ_ΛΙΣΤΑΣ[ i ]
ΔΟΜΕΣ ΔΕΔΟΜΕΝΩΝ
 ΛΕΞΙΚΑ
 ΟΝΟΜΑ_ΛΕΞΙΚΟΥ = { ΚΛΕΙΔΙ1 : ΤΙΜΗ1,
ΚΛΕΙΔΙ2 : ΤΙΜΗ2,… ΚΛΕΙΔΙΝ : ΤΙΜΗΝ , }
 ΣΥΣΧΕΤΙΖΕΙ ΜΙΑ ΤΙΜΗ ΜΕ ΕΝΑ ΚΛΕΙΔΙ
 ΓΙΑ ΝΑ ΠΑΡΟΥΜΕ ΤΗΝ ΤΙΜΗ ΤΟΥ i-ΟΣΤΟΥ
ΚΛΕΙΔΙΟΥ ΔΙΝΟΥΜΕ
 ΟΝΟΜΑ_ΛΕΞΙΚΟΥ[ΚΛΕΙΔΙi ]
ΔΟΜΕΣ ΔΕΔΟΜΕΝΩΝ
 ΠΛΕΙΑΔΕΣ
 ΟΝΟΜΑ_ΠΛΕΙΑΔΑΣ = (
ΣΤΟΙΧΕΙΟ_ΠΛΕΙΑΔΑΣ1,
ΣΤΟΙΧΕΙΟ_ΠΛΕΙΑΔΑΣ2, …
ΣΤΟΙΧΕΙΟ_ΠΛΕΙΑΔΑΣΝ ,)
 ΧΡΗΣΗΜΟΠΟΙΕΙΤΑΙ ΓΙΑ ΟΜΑΔΟΠΟΙΗΣΗ
ΔΕΔΟΜΕΝΩΝ
 ΓΙΑ ΝΑ ΑΝΑΦΕΡΘΟΥΜΕ ΣΤΟ i-ΟΣΤΟ
ΣΤΟΙΧΕΙΟ ΤΗΣ ΠΛΕΙΑΔΑΣ :
 ΟΝΟΜΑ_ΠΛΕΙΑΔΑΣ[ i ]
ΔΟΜΕΣ ΔΕΔΟΜΕΝΩΝ
 ΜΠΟΡΟΥΜΕ ΝΑ ΠΑΡΟΥΜΕ ΕΝΑ ΜΕΡΟΣ ΤΗΣ
ΛΙΣΤΑΣ, ΤΟΥ ΛΕΞΙΚΟΥ Η ΤΗΣ ΠΛΕΙΑΔΑΣ.
 ΤΑ ΣΤΟΙΧΕΙΑ ΤΩΝ ΛΙΣΤΩΝ ΚΑΙ ΤΩΝ ΛΕΞΙΚΩΝ
ΜΠΟΡΟΥΝ ΝΑ ΑΛΛΑΞΟΥΝ, ΑΛΛΑ ΤΑ
ΣΤΟΙΧΕΙΑ ΤΩΝ ΠΛΕΙΑΔΩΝ ΟΧΙ.
 ΜΠΟΡΟΥΜΕ ΝΑ ΑΝΑΘΕΣΟΥΜΕ ΜΙΑ ΛΙΣΤΑ
ΣΕ ΜΙΑ ΠΛΕΙΑΔΑ ΚΑΙ ΤΟ ΑΝΤΙΘΕΤΟ.
 ΤΑ ΣΤΟΙΧΕΙΑ ΤΩΝ ΛΙΣΤΩΝ, ΤΩΝ ΛΕΞΙΚΩΝ ΚΑΙ
ΤΩΝ ΠΛΕΙΑΔΩΝ ΔΕΝ ΕΙΝΑΙ ΑΠΑΡΑΙΤΗΤΟ ΝΑ
ΕΙΝΑΙ ΙΔΙΟΥ ΤΥΠΟΥ.

Más contenido relacionado

Destacado

Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Applitools
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at WorkGetSmarter
 
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...DevGAMM Conference
 
Barbie - Brand Strategy Presentation
Barbie - Brand Strategy PresentationBarbie - Brand Strategy Presentation
Barbie - Brand Strategy PresentationErica Santiago
 
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them wellGood Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them wellSaba Software
 

Destacado (20)

Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
 
ChatGPT webinar slides
ChatGPT webinar slidesChatGPT webinar slides
ChatGPT webinar slides
 
More than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike RoutesMore than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike Routes
 
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
 
Barbie - Brand Strategy Presentation
Barbie - Brand Strategy PresentationBarbie - Brand Strategy Presentation
Barbie - Brand Strategy Presentation
 
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them wellGood Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
 

python part1 2015.ppt

  • 2. ΠΛΕΟΝΕΚΤΗΜΑΤΑ  ΑΠΛΗ  ΕΥΚΟΛΗ ΣΤΗ ΜΑΘΗΣΗ  OPEN SOURCE  ΥΨΗΛΟΥ ΕΠΙΠΕΔΟΥ(SCRIPT)  ΑΝΕΞΑΡΤΗΤΗ ΛΕΙΤΟΥΡΓΙΚΟΥ ΣΥΣΤΗΜΑΤΟΣ  ΔΙΕΡΜΗΝΕΥΟΜΕΝΗ  ΑΝΤΙΚΕΙΜΕΝΟΣΤΡΑΦΗΣ
  • 3. ΒΑΣΙΚΟΙ ΤΥΠΟΙ ΔΕΔΟΜΕΝΩΝ  ΕΜΜΕΣΗ ΔΗΛΩΣΗ ΜΕΤΑΒΛΗΤΩΝ  ΜΕΤΑΒΛΗΤΕΣ  ΑΡΙΘΜΗΤΙΚΕΣ (ΑΚΕΡΑΙΟΙ, ΠΡΑΓΜΑΤΙΚΟΙ, ΜΙΓΑΔΙΚΟΙ)  ΑΛΦΑΡΙΘΜΗΤΙΚΕΣ (‘…’, ”…”, ‘’’…’’’, “””…”””)  ΛΟΓΙΚΕΣ (True, False)
  • 4. ΒΑΣΙΚΟΙ ΤΥΠΟΙ ΔΕΔΟΜΕΝΩΝ  ΤΑ ΟΝΟΜΑΤΑ ΤΩΝ ΜΕΤΑΒΛΗΤΩΝ ΠΕΡΙΕΧΟΥΝ  ΤΑ ΓΡΑΜΜΑΤΑ ΤΟΥ ΑΓΓΛΙΚΟΥ ΑΛΦΑΒΗΤΟΥ ( ΠΕΖΑ - ΚΕΦΑΛΑΙΑ )  ΤΟ ΧΑΡΑΚΤΗΡΑ “ _ “  ΤΑ ΨΗΦΙΑ 0,1,2,3,4,5,6,7,8,9  ΤΟ ΟΝΟΜΑ ΠΡΕΠΕΙ ΝΑ ΑΡΧΙΖΕΙ ΜΕ ΓΡΑΜΜΑ Η΄ “ _ “
  • 5. ΠΡΑΞΕΙΣ ΜΕ ΜΕΤΑΒΛΗΤΕΣ  ΑΡΙΘΜΗΤΙΚΕΣ +, -, *, /, **, //, %, <<, >> &, |, ^, ~ <, >, ==,<=, >=, !=  ΑΛΦΑΡΙΘΜΗΤΙΚΕΣ + <, >, ==,<=, >=, !=  ΛΟΓΙΚΕΣ not, and, or
  • 6. ΜΟΡΦΗ ΠΡΟΓΡΑΜΜΑΤΟΣ  ΕΝΤΟΛΕΣ  ΑΝ ΒΡΙΣΚΟΝΤΑΙ ΣΤΗΝ ΙΔΙΑ ΓΡΑΜΜΗ ΔΙΑΧΩΡΙΖΟΝΤΑΙ ΜΕ “ ; ”.  ΑΝ ΒΡΙΣΚΟΝΤΑΙ ΣΕ ΔΙΑΦΟΡΕΤΙΚΗ ΓΡΑΜΜΗ ΤΟ “ ; ” ΜΠΟΡΕΙ ΝΑ ΠΑΡΑΛΕΙΦΘΕΙ.
  • 7. ΜΟΡΦΗ ΠΡΟΓΡΑΜΜΑΤΟΣ  ΟΙ ΛΕΥΚΟΙ ΧΑΡΑΚΤΗΡΕΣ ( ΚΕΝΑ ΚΑΙ ΤΑΒ ) ΣΤΗΝ ΑΡΧΗ ΤΩΝ ΓΡΑΜΜΩΝ ΟΜΑΔΟΠΟΙΟΥΝ ΤΙΣ ΕΝΤΟΛΕΣ ΣΕ ΟΜΑΔΕΣ ΕΝΤΟΛΩΝ ( ΜΠΛΟΚ ).  ΤΟ ΣΥΜΒΟΛΟ # ΧΡΗΣΙΜΟΠΟΙΕΙΤΑΙ ΓΙΑ ΤΗΝ ΕΙΣΑΓΩΓΗ ΣΧΟΛΙΩΝ.
  • 8. ΕΝΤΟΛΕΣ  =  ΑΝΑΘΕΣΗ ΤΙΜΗΣ  Print  ΕΜΦΑΝΙΖΕΙ ΣΤΗΝ ΟΘΟΝΗ  Input  ΔΙΑΒΑΖΕΙ ΑΠΌ ΤΟ ΠΛΗΚΡΟΛΟΓΙΟ
  • 9. ΕΝΤΟΛΕΣ  if συνθήκη : Μπλοκ εντολών elif συνθήκη : Μπλοκ εντολών else : Μπλοκ εντολών
  • 10. ΕΝΤΟΛΕΣ  while συνθήκη : Μπλοκ εντολών else : Μπλοκ εντολών
  • 11. ΕΝΤΟΛΕΣ  for μεταβλητή in λίστα_τιμών : Μπλοκ εντολών else : Μπλοκ εντολών
  • 12. ΕΝΤΟΛΕΣ  break  ΧΡΗΣΙΜΟΠΟΙΕΙΤΑΙ ΓΙΑ ΝΑ ΒΓΟΥΜΕ ΑΠΌ ΒΡΟΧΟΥΣ for και while.  continue  ΧΡΗΣΙΜΟΠΟΙΕΙΤΑΙ ΓΙΑ ΝΑ ΠΑΜΕ ΣΤΗΝ ΕΠΟΜΕΝΗ ΕΠΑΝΑΛΗΨΗ for Η while.
  • 13. ΣΥΝΑΡΤΗΣΕΙΣ  def όνομα_συνάρτησης ( παράμετροι ): Μπλοκ εντολών  ΟΙ ΠΑΡΑΜΕΤΡΟΙ ΜΠΟΡΟΥΝ ΚΑΙ ΝΑ ΜΗΝ ΥΠΑΡΧΟΥΝ  ΑΝ ΤΟ Μπλοκ εντολών ΔΕΝ ΥΠΑΡΧΕΙ ΠΡΕΠΕΙ ΝΑ ΒΑΛΟΥΜΕ ΤΗΝ ΛΕΞΗ pass  ΥΠΟΣΤΗΡΙΖΕΤΑΙ ΥΠΕΡΦΟΡΤΩΣΗ ΣΥΝΑΡΤΗΣΕΩΝ  ΥΠΟΣΤΗΡΙΖΕΤΑΙ ΑΡΧΙΚΟΠΟΙΗΣΗ ΠΑΡΑΜΕΤΡΩΝ
  • 14. ΣΥΝΑΡΤΗΣΕΙΣ  ΓΙΑ ΝΑ ΕΠΙΣΤΡΕΨΟΥΜΕ ΜΙΑ ΤΙΜΗ ΑΠΟ ΣΥΝΑΡΤΗΣΗ ΧΡΗΣΙΜΟΠΟΙΟΥΜΕ ΤΗΝ ΕΝΤΟΛΗ return.  ΕΜΦΑΝΙΣΗ ΠΛΗΡΟΦΟΡΙΩΝ ΤΗΣ ΣΥΝΑΡΤΗΣΗΣ ΓΙΝΕΤΑΙ ΜΕ ΤΟ DocString ΤΟ ΟΠΟΙΟ ΚΑΘΟΡΙΖΕΙ Ο ΔΗΜΙΟΥΡΓΟΣ ΤΗΣ ΣΥΝΑΡΤΗΣΗΣ (__doc__)
  • 15. ΑΡΧΕΙΑ  ΓΙΑ ΝΑ ΧΡΗΣΙΜΟΠΟΙΗΣΟΥΜΕ ΜΙΑ ΣΥΝΑΡΤΗΣΗ ‘Η ΜΕΤΑΒΛΗΤΗ ΠΟΥ ΕΙΝΑΙ ΣΕ ΔΙΑΦΟΡΕΤΙΚΟ ΑΡΧΕΙΟ  ΚΑΝΟΥΜΕ import ΤΟ ΣΥΓΚΕΚΡΙΜΕΝΟ ΑΡΧΕΙΟ  ΤΗΝ ΚΑΛΟΥΜΕ ΜΕ ΤΟ ΟΝΟΜΑ_ΑΡΧΕΙΟΥ.ΟΝΟΜΑ_ΣΥΝΑΡΤΗΣΗΣ  ΤΟ ΣΥΓΚΕΚΡΙΜΕΝΟ ΑΡΧΕΙΟ ΟΝΟΜΑΖΕΤΑΙ module
  • 16. ΔΟΜΕΣ ΔΕΔΟΜΕΝΩΝ  ΛΙΣΤΕΣ  ΟΝΟΜΑ_ΛΙΣΤΑΣ = [ ΣΤΟΙΧΕΙΟ_ΛΙΣΤΑΣ1, ΣΤΟΙΧΕΙΟ_ΛΙΣΤΑΣ2, … ΣΤΟΙΧΕΙΟ_ΛΙΣΤΑΣΝ, ]  ΓΙΑ ΝΑ ΑΝΑΦΕΡΘΟΥΜΕ ΣΤΟ i-ΟΣΤΟ ΣΤΟΙΧΕΙΟ ΤΗΣ ΛΙΣΤΑΣ :  ΟΝΟΜΑ_ΛΙΣΤΑΣ[ i ]
  • 17. ΔΟΜΕΣ ΔΕΔΟΜΕΝΩΝ  ΛΕΞΙΚΑ  ΟΝΟΜΑ_ΛΕΞΙΚΟΥ = { ΚΛΕΙΔΙ1 : ΤΙΜΗ1, ΚΛΕΙΔΙ2 : ΤΙΜΗ2,… ΚΛΕΙΔΙΝ : ΤΙΜΗΝ , }  ΣΥΣΧΕΤΙΖΕΙ ΜΙΑ ΤΙΜΗ ΜΕ ΕΝΑ ΚΛΕΙΔΙ  ΓΙΑ ΝΑ ΠΑΡΟΥΜΕ ΤΗΝ ΤΙΜΗ ΤΟΥ i-ΟΣΤΟΥ ΚΛΕΙΔΙΟΥ ΔΙΝΟΥΜΕ  ΟΝΟΜΑ_ΛΕΞΙΚΟΥ[ΚΛΕΙΔΙi ]
  • 18. ΔΟΜΕΣ ΔΕΔΟΜΕΝΩΝ  ΠΛΕΙΑΔΕΣ  ΟΝΟΜΑ_ΠΛΕΙΑΔΑΣ = ( ΣΤΟΙΧΕΙΟ_ΠΛΕΙΑΔΑΣ1, ΣΤΟΙΧΕΙΟ_ΠΛΕΙΑΔΑΣ2, … ΣΤΟΙΧΕΙΟ_ΠΛΕΙΑΔΑΣΝ ,)  ΧΡΗΣΗΜΟΠΟΙΕΙΤΑΙ ΓΙΑ ΟΜΑΔΟΠΟΙΗΣΗ ΔΕΔΟΜΕΝΩΝ  ΓΙΑ ΝΑ ΑΝΑΦΕΡΘΟΥΜΕ ΣΤΟ i-ΟΣΤΟ ΣΤΟΙΧΕΙΟ ΤΗΣ ΠΛΕΙΑΔΑΣ :  ΟΝΟΜΑ_ΠΛΕΙΑΔΑΣ[ i ]
  • 19. ΔΟΜΕΣ ΔΕΔΟΜΕΝΩΝ  ΜΠΟΡΟΥΜΕ ΝΑ ΠΑΡΟΥΜΕ ΕΝΑ ΜΕΡΟΣ ΤΗΣ ΛΙΣΤΑΣ, ΤΟΥ ΛΕΞΙΚΟΥ Η ΤΗΣ ΠΛΕΙΑΔΑΣ.  ΤΑ ΣΤΟΙΧΕΙΑ ΤΩΝ ΛΙΣΤΩΝ ΚΑΙ ΤΩΝ ΛΕΞΙΚΩΝ ΜΠΟΡΟΥΝ ΝΑ ΑΛΛΑΞΟΥΝ, ΑΛΛΑ ΤΑ ΣΤΟΙΧΕΙΑ ΤΩΝ ΠΛΕΙΑΔΩΝ ΟΧΙ.  ΜΠΟΡΟΥΜΕ ΝΑ ΑΝΑΘΕΣΟΥΜΕ ΜΙΑ ΛΙΣΤΑ ΣΕ ΜΙΑ ΠΛΕΙΑΔΑ ΚΑΙ ΤΟ ΑΝΤΙΘΕΤΟ.  ΤΑ ΣΤΟΙΧΕΙΑ ΤΩΝ ΛΙΣΤΩΝ, ΤΩΝ ΛΕΞΙΚΩΝ ΚΑΙ ΤΩΝ ΠΛΕΙΑΔΩΝ ΔΕΝ ΕΙΝΑΙ ΑΠΑΡΑΙΤΗΤΟ ΝΑ ΕΙΝΑΙ ΙΔΙΟΥ ΤΥΠΟΥ.