As you write a program, you may want to enter it yourself and move it accordingly.
Here we use input ().
Here, we put characters in a variable called word.
If you print it, it will come out as it is.
word = input()
aiueo
print(word)
aiueo
It can also be numbers.
However, the input method changes a little depending on whether you treat it as a letter or a number.
In the case of letters, it takes the form of input () as it is, and in the case of numbers, it takes the form of int (input ()).
Even if the same 1 is used, the treatment will be different as mentioned above depending on whether or not to add an int.
one = input()
two = int(input())
1
1
print(one + one)
print(two + two)
11
2
Note that if you put ordinary characters in int (input ()), an error will occur.
print(int(input()))
afsfa
ValueError Traceback (most recent call last)
<ipython-input-5-4d16d49e5846> in <module>
----> 1 print(int(input()))
ValueError: invalid literal for int() with base 10: 'afsfa'
Click here for a list of each story.
[The same content is also available in the video, so please have a look. ](Mayungo's Python Learning Episode 8: I tried input)