Focus mode

Veri Bilimi

Input

Input

  • Bazen kullanacağımız değeri kullanıcıdan almak isteyebiliriz. Bunu input metodu ile yapacağız
  • input'un içinde yazacağımız bize kullanıcıya gösterilecek yazıyı verecek, kullanıcıdan girdi bekleyip enter'a basmasını bekleyecek, ve girdiyi string olarak döndürecek
x = input("Bir sayı girin:")


x + 10
---------------------------------------------------------------------------

TypeError                                 Traceback (most recent call last)

<ipython-input-51-dacbb30d0a09> in <module>
----> 1 x + 10
TypeError: can only concatenate str (not "int") to str
type(x)


int(x) + 10


x = int(input("Bir sayı girin:"))
Bir sayı girin:10
x + 10


mesaj = input("Mesajı girin:")


isim = input("İsim girin:")


mesaj + " " + isim


Test

Comments

You need to enroll in the course to be able to comment!