summaryrefslogtreecommitdiffhomepage
path: root/python.html.markdown
diff options
context:
space:
mode:
authorAnkit Aggarwal <ankitaggarwal011@gmail.com>2015-10-14 10:27:25 +0530
committerAnkit Aggarwal <ankitaggarwal011@gmail.com>2015-10-14 10:27:25 +0530
commite1d2f8c718858323e1716cc0bde4c652e9b87ce6 (patch)
tree557d331b80bd98dfd8e0e7fa36c17226d7bb8653 /python.html.markdown
parent9ee3a687204cbe6caaa11b9fd28470651a70ae2b (diff)
Updated the input() method usage and description
Diffstat (limited to 'python.html.markdown')
-rw-r--r--python.html.markdown7
1 files changed, 4 insertions, 3 deletions
diff --git a/python.html.markdown b/python.html.markdown
index 95146ca8..11642ff8 100644
--- a/python.html.markdown
+++ b/python.html.markdown
@@ -4,7 +4,6 @@ contributors:
- ["Louie Dinh", "http://ldinh.ca"]
- ["Amin Bandali", "http://aminbandali.com"]
- ["Andre Polykanine", "https://github.com/Oire"]
- - ["Ankit Aggarwal", "http://ankitaggarwal.me"]
filename: learnpython.py
---
@@ -146,8 +145,10 @@ bool("") # => False
print "I'm Python. Nice to meet you!"
# Simple way to get input data from console
-input_string_var = raw_input("Enter some data: ") # Data is stored as a string
-input_number_var = input("Enter a number: ") # Data is stored as a number
+input_string_var = raw_input("Enter some data: ") # Returns the data as a string
+input_var = input("Enter some data: ") # Evaluates the data as python code
+# Warning: Caution is recommended for input() method usage
+# Note: In python 3, input() is deprecated and raw_input() is renamed to input()
# No need to declare variables before assigning to them.
some_var = 5 # Convention is to use lower_case_with_underscores