Professional Documents
Culture Documents
Class 12 CSproject
Class 12 CSproject
PRACTICES
POWERPOINT PRESENTATION
VISHNU CHOUDHARY
• INTRODUCTION:
-EASY TO USE
-DYNAMICALLY TYPED
-EXPRESSIVE LANGUAGE
-INTERPRETED LANGUAGE
-CROSS-PLATFORM LANGUAGE
-FREE AND OPEN SOURCE
If you are in the standard Python shell, you can click "File" then choose "New" or simply hit "Ctrl + N" on your
keyboard to open a blank script in which you can write your code. You can then press "Ctrl + S" to save it.
After writing your code, you can run it by clicking "Run" then "Run Module" or simply press F5.
Let us create a new file from the Python shell and give it the name "hello.py". We need to run the "Hello World"
program. Add the following code to the file:
print(“Hello World”)
Click "Run" then choose "Run Module". This will run the program:
Output
Hello World
SCRIPT MODE ADVANTAGES
-It is easy to run large pieces of code.
- your script is easier in script mode.
-Good for both beginners and experts.
Interactive mode is where you type your code into the Python interpreter directly. This is useful for
trying out small snippets of code, or for testing things out as you’re writing them.
The >>> indicates that the Python shell is ready to execute and send your commands to the Python
interpreter. The result is immediately displayed on the Python shell as soon as the Python interpreter
interprets the command.
To run your Python statements, just type them and hit the enter key. You will get the results
immediately, unlike in script mode. For example, to print the text "Hello World", we can type the
following:
name=
age=26
course= "Computer Science"
print=>>> name = "Nicholas" >>> age = 26 >>> course = "Computer Science" >>> print("My name is "
+ name + ", aged " + str(age) + ", taking " + course)
Output
-Helpful when your script is extremely short and you want immediate results.
-Faster as you only have to type a command and then press the enter key to get the results.
-Good for beginners who need to understand Python basics.
INTERACTIVE MODE DISADVANTAGES
-Editing the code in interactive mode is hard as you have to move back to the
previous commands or else you have to rewrite the whole command again.
-It's very tedious to run long pieces of code.
-If we 'save the program the instructions' also get saved.
Spyder is a powerful interactive development environment for the Python language with
advanced setting, interactive testing, debugging and introspection features. In fact, DataCamp
community recommends Spyder IDE comes preloaded with Anaconda distribution.
FEATURES OF SPYDER