What is error in this code ,please help me | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

What is error in this code ,please help me

https://code.sololearn.com/cP2DQy5DEwyX/?ref=app

21st Jun 2019, 12:12 PM
Pulkit soni
Pulkit soni - avatar
6 Answers
+ 8
Pulkit soni I'll just paste my answer to another question here, maybe it helps. You'll usually use one of the following two types of programs to run your Python code: 1) interactive shell like iPython, IDLE, python in a console session etc. 2) IDE like Spyder, Jupyter, PyCharm etc. An interactive shell expects your input line by line. It usually shows some kind of prompt like >>> or In [1]: informing you that it is waiting for your input. When you type a variable's name and hit enter, the value of the variable will be printed. E.g.: Python console session >>> a = 5 >>> a 5 An IDE usually won't process your input line by line, but lets you write a script and will run the whole script once you press F5 or some other key. It will never output anything (well, except for error messages) unless you explicitly tell it to, using the print() command: a = 5 a If you run this script, nothing will happen. If you run THIS script: a = 5 print(a) , the output will be 5.
21st Jun 2019, 12:29 PM
Anna
Anna - avatar
+ 3
>>> is only the command prompt of the python interpreter.
21st Jun 2019, 12:24 PM
Théophile
Théophile - avatar
+ 2
You don't need >>>. Just write : print(2 * 3)
21st Jun 2019, 12:15 PM
Théophile
Théophile - avatar
+ 1
The same, >>> is useless. It is not a part of a python program. It is 'used' in IDLE but it is just the py interpreter. So write : print("all you want") In the python course, they never use >>>. Read it again.
21st Jun 2019, 12:23 PM
Théophile
Théophile - avatar
21st Jun 2019, 12:20 PM
Pulkit soni
Pulkit soni - avatar
0
Anna thnx
21st Jun 2019, 12:31 PM
Pulkit soni
Pulkit soni - avatar