GithubHelp home page GithubHelp logo

js-exercise's Introduction

JS-exercises

JS-Odev1

Basitçe sizden girişte isminizi isteyip sonra bu ismi karşılama ekranına yerleştirerek o anki saati ve günü gösteren bir ekran yapdım. Bunu hem JavaScript ile hemde Python ile yaptım. İlginç gelebilir basit bir kurulumun ardından <py-script>print("hello world")</py-script> şeklinde Python kodlarınızı HTML sayfanıza ekleyebilirsiniz.

<py-script>
import asyncio
import datetime as dt

while True:
  await asyncio.sleep(1)
  zaman = dt.datetime.now()
  haftaningunu = dt.datetime.strftime(zaman, '%A')
  pyscript.write("today2",f"{zaman.day}/{zaman.month}/{zaman.year}  {zaman.hour}:{zaman.minute}:{zaman.second} {haftaningunu}")
 <py-script>

image

Aynı işi yapan JavaScript Kodlarımda şu şekilde

let adiniz = prompt("Adiniz : ","Lütfen adinizi giriniz")

document.querySelector("#selam").innerHTML = `Merhaba, <b>${adiniz}!</b> Hoş geldin!`
function tarihyaz(){
    var tarih=new Date();
    let haftaningunu = tarih.getDay();
    let gun;
    switch (haftaningunu){
        case 1:
            gun ="Pazartesi"
            break;
        case 2:
            gun ="Salı"
            break;
        case 3:
            gun ="Çarşamba"
            break;
        case 4:
            gun ="Perşembe"
            break;
        case 5:
            gun ="Cuma"
            break;
        case 6:
            gun ="Cumartesi"
            break;
        case 7:
            gun ="Pazar"
            break;
    }

    document.querySelector("#today").innerHTML =`${tarih.getDate()}/${tarih.getMonth()+1}/${tarih.getFullYear()} ${tarih.getHours()}:${tarih.getMinutes()}:${tarih.getSeconds()} ${gun}`

    var time
    time = setInterval('tarihyaz()', 1000);
}
tarihyaz()

js-exercise's People

Contributors

mtalhaaygen avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.