Share to:

Python (programski jezik)

Python
Programska ParadigmaVišestruka: funkcionalno, imperativno, objektno orijentisano, refleksivno
Pojavio se1990; prije 36 godina (1990)
TvoracGuido van Rossum
RazvijačPython Software Foundation
Sistem tipovanjaDuck, dinamičko
DijalektiCython, RPython, Starlark[1]
UtjecaliABC, ALGOL 68, APL, C, C++, CLU, Dylan, Haskell, Icon, Java, Lisp, Modula-3, Perl, Standard ML
Utjecao naApache Groovy, Boo, Cobra, CoffeeScript,[2] D, F#, Genie,[3] Go, JavaScript,[4][5] Julia, Nim, Ring, Ruby, Swift

Python jest programski jezik visokog nivoa opće namjene. Podržava imperativni, objektno-orijentisani i funkcionalni stil programiranja. Sintaksa jezika omogućava pisanje veoma preglednih programa. Jezik se brzo i lako uči. Programi pisani u Pythonu se najčešće interpretiraju. Uz interpretator se obično isporučuje i veoma razvijena standardna biblioteka [6] modula.

Python je krajem 1980-ih[7] osmislio Guido van Rossum u Centrum Wiskunde & Informatica (CWI) u Nizozemskoj kao nasljednika jezika ABC.[8]

Primjeri programiranja u Pythonu

Hello World program:

print("Hello, world!")

Program za parne i neparne brojeve:

broj = int(input("Unesite neki broj: "))
if broj % 2 == 0:
    print("Uneseni broj je paran!")
else:
    print("Uneseni broj je neparan!")

Program da se uneseni brojevi spoje u jednu listu (array):

lista = []
broj = int(input())
for i in range(0, broj):
    element = int(input())
    lista.append(element)
print(lista)

Program da se izračuna površina kruga:

import math

poluprecnik = float(input("Unesite dužinu poluprečnika: "))

#Napomena: poluprečnik na kvadrat se može napisati i kao pow(poluprecnik, 2), ali radi efikasnosti, predlaže se ova opcija => (poluprecnik**2)

povrsinaKruga = poluprecnik**2 * math.pi

print("Površina kruga iznosi: ", povrsinaKruga, "metara na kvadrat")

Reference

  1. ^ "Starlark Language". Pristupljeno 25. 5. 2019.
  2. ^ "CoffeeScript borrows chained comparisons from Python".
  3. ^ "Genie Language - A brief guide". Pristupljeno 28. 12. 2015.
  4. ^ "Perl and Python influences in JavaScript". www.2ality.com. 24. 2. 2013. Pristupljeno 15. 5. 2015.
  5. ^ Rauschmayer, Axel. "Chapter 3: The Nature of JavaScript; Influences". O'Reilly, Speaking JavaScript. Arhivirano s originala, 26. 12. 2018. Pristupljeno 15. 5. 2015.
  6. ^ "Node.js vs Python: Which backend technology to choose in 2021?". Insights on Latest Technologies - Simform Blog (jezik: engleski). 19. 2. 2021. Pristupljeno 3. 6. 2021.
  7. ^ Venners, Bill (13 January 2003). "The Making of Python". Artima Developer. Artima. Retrieved 22 March 2007.
  8. ^ van Rossum, Guido (29 August 2000). "SETL (was: Lukewarm about range literals)". Python-Dev (Mailing list). Retrieved 13 March 2011.

Izvori

Dalje čitanje

Vanjski linkovi


Content Disclaimer

Informasi ini disarikan dari Wikipedia dan disajikan kembali untuk tujuan edukasi. Konten tersedia di bawah lisensi CC BY-SA 3.0. Kami tidak bertanggung jawab atas ketidakakuratan data yang bersumber dari kontribusi publik tersebut.

  1. The information displayed on this website is sourced in part or in whole from Wikipedia and has been adapted for the purpose of restating it. We strive to provide accurate and relevant information, however:
  2. There is no guarantee of absolute accuracy. Wikipedia is an open, collaborative project that can be edited by anyone, so information is subject to change.
  3. It is not intended to constitute professional advice. The content displayed is for informational and educational purposes only. For important decisions (e.g., medical, legal, or financial), please consult a professional.
  4. Content copyright. Wikipedia is licensed under the Creative Commons Attribution-ShareAlike License (CC BY-SA). This means that content may be reused with appropriate attribution and shared under a similar license.
  5. Responsible use. Any risk arising from the use of information from this website is entirely the responsibility of the user.
Prefix: a b c d e f g h i j k l m n o p q r s t u v w x y z 0 1 2 3 4 5 6 7 8 9

Portal di Ensiklopedia Dunia

Kembali kehalaman sebelumnya