Jump to content
DetoX

[Python] Declaratie de citire

Recommended Posts

3.x

x = input("Introdu ceva: ")

=> type(x) -> class "str"

2.x

x = raw_input("Introdu ceva: ")

Are acelasi efect ca la versiunea 3.x, numai ca raw_input() difera de input().

raw_input() == str(input())

input() == eval(raw_input()) -> evalueaza input-ul vazut ca cod

La versiunea 3.x nu mai exista raw_input(), e doar input() care returneaza un string.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...