Merge pull request #1514 from ankitaggarwal011/python3-input-operations-add

[python3/en] Added instructions on how to perform input operations
This commit is contained in:
Levi Bostian 2015-10-15 13:03:30 -05:00
commit c2b7b81fe4

View File

@ -160,6 +160,10 @@ print("I'm Python. Nice to meet you!") # => I'm Python. Nice to meet you!
# Use the optional argument end to change the end character. # Use the optional argument end to change the end character.
print("Hello, World", end="!") # => Hello, World! print("Hello, World", end="!") # => Hello, World!
# Simple way to get input data from console
input_string_var = input("Enter some data: ") # Returns the data as a string
# Note: In earlier versions of Python, input() method was named as raw_input()
# No need to declare variables before assigning to them. # No need to declare variables before assigning to them.
# Convention is to use lower_case_with_underscores # Convention is to use lower_case_with_underscores
some_var = 5 some_var = 5