folder Tahribat.com Forumları
linefolder Python
linefolder Indentation İle İlgili Bi Soru



Indentation İle İlgili Bi Soru

  1. KısayolKısayol reportŞikayet pmÖzel Mesaj
    ataturkcu1
    ataturkcu1's avatar
    Kayıt Tarihi: 20/Nisan/2007
    Erkek

    Muridler benim indentation ile ilgili basit bi sorum olacak.Hocanin derste yazdigi kod su:

    import bottle

    @bottle.route("/hello")
    def say_hello():
        output = """
          <html>
            <head>
              <title>Hello</title>
              <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
            </head>
            <body>
              <p>Hello world!</p>
            </body>
          </html>
        """
        return output

    bottle.run(host='localhost', port=8080)

    Benim yazdigim kod ise su:

    import bottle

    @bottle.route("/hello05")
    def say_hello():
        output = """
        <html>
        <head>
        <title>What the fuck is wrong with people?</title>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        </head>
        <body>
        <p>Hello World!</p>
        </body>
        </html>
        """
            return output
    bottle.run(host="localhost",port=8080)

     

    Benim anlamadigim kisim da su:Hocanin kodunda return output kismi satirin baslangicindan itibaren 4 space.Benim kodumdaki space sayisi ise 8.8 yapmazsam olmuyo,calismiyo kod.Nedir bunun sebeb i hikmeti?Yardimlariniz icin simdiden sagolun.

     


    Pragmatism&Realism
  2. KısayolKısayol reportŞikayet pmÖzel Mesaj
    ataturkcu1
    ataturkcu1's avatar
    Kayıt Tarihi: 20/Nisan/2007
    Erkek

    Yardimci olabilecek murid yok mu ?


    Pragmatism&Realism
Toplam Hit: 1149 Toplam Mesaj: 2