rric

Bisschen mehr Python

Oct 17th, 2023
854
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 2.15 KB | None | 0 0
  1. # Etwas mehr Informationen zu Python [Mu: Python 3]
  2. # Copyright 2021-2023 Roland Richter
  3.  
  4. # Schreibe Text in die Konsole
  5. print("Hallo Welt!")
  6.  
  7. # QUIZ Jede dieser Zeilen ist fehlerhaft; siehst du, warum?
  8. #      Lösche ein '#'-Zeichen und beobachte, was passiert:
  9. # pirnt("Hallo Welt!")
  10. # print("Hallo Welt!"
  11. # print("Hallo Welt!)
  12. # print("Hallo Welt!"))
  13. # print("Hallo Wlet!")
  14.  
  15. # TIPP Um deinen Code auf Fehler zu prüfen, drücke "Prüfen";
  16. #      oft ist es auch hilfreich, deinen Code mit "Tidy" aufzuräumen.
  17.  
  18. # Noch einige Fakten über Python:
  19. name = "Guido van Rossum"
  20. year = 1991
  21. # `name` ist eine Variable und enthält Text; `year` ist auch eine Variable
  22. # und enthält eine Zahl. print() kann sowohl Text als auch Zahlen ausgeben.
  23. print("Python wurde", year, "von", name, "entwickelt.")
  24.  
  25. # TIPP Du kannst sowohl "" als auch '' als Anführungszeichen für Text verwenden
  26. #     🠗                🠗                             🠗                🠗
  27. print('2021 war Python "Programmiersprache des Jahres" des TIOBE Index')
  28.  
  29. # TIPP Das "Schlange"-Zeichen findest du auf https://old.unicode-table.com/en/1F40D/
  30. print("Für Python wird oft das 'Schlange'-Zeichen verwendet", "🐍")
  31.  
  32. # Mit + kannst du nicht nur Zahlen addieren, sondern auch Text verbinden:
  33. flying_circus = "Monty Python"
  34. print("aber der Name stammt von der britischen Komikergruppe " + flying_circus)
  35. print("Die aktuelle Version der Sprache ist Python", 1 + 1 + 1)
  36.  
  37.  
  38. # ----------------------------------------------------------------------
  39. # This program is free software: you can redistribute it and/or modify
  40. # it under the terms of the GNU General Public License as published by
  41. # the Free Software Foundation, either version 3 of the License, or
  42. # (at your option) any later version.
  43. #
  44. # This program is distributed in the hope that it will be useful,
  45. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  46. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  47. # GNU General Public License for more details.
  48. #
  49. # You should have received a copy of the GNU General Public License
  50. # along with this program.  If not, see <https://www.gnu.org/licenses/>.
  51.  
Advertisement
Add Comment
Please, Sign In to add comment