[Python study notes] input and output

Input


Python providesinput(), Allows the user to enter a string and store it in a variable. Insert picture description here
code show as below

>>> name=input()
mike
>>> name
'mike'input
>>> print(name)
mike
>>> print('name')
name

name is a variable, we put input() That is the input string mike Assigned to it.

Print


use print()The specified text can be output by adding a character string in parentheses.
You can output a character string or a calculation result.

Insert picture description herecode show as below

>>> print('hello, world')
hello, world
>>> print('what','the','fuck')
what the fuck
>>> print(12+21)
33
Published 18 original articles · Likes6 · Visits 1859

Guess you like

Origin blog.csdn.net/qq_43479203/article/details/105044063