Mentions légales du service

Skip to content
Snippets Groups Projects
Commit a6b17dc7 authored by ANDRADE-BARROSO Guillermo's avatar ANDRADE-BARROSO Guillermo
Browse files

update python3 version code

parent 77d88111
No related branches found
No related tags found
No related merge requests found
......@@ -13,8 +13,8 @@ Python come with an interpreter console, you can launch it just typing :
```
$ python
Python 2.7.2+ (default, Jul 20 2012, 22:15:08)
[GCC 4.6.1] on linux2
Python 3.8.5 (default, Jul 28 2020, 12:59:40)
[GCC 9.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> 5+7
12
......@@ -27,15 +27,11 @@ There is a very powerful and comfortable interactive console named Ipython. Ipyt
```
$ ipython
Python 2.7.2+ (default, Jul 20 2012, 22:15:08)
Type "copyright", "credits" or "license" for more information.
Python 3.8.5 (default, Jul 28 2020, 12:59:40)
Type 'copyright', 'credits' or 'license' for more information
IPython 7.13.0 -- An enhanced Interactive Python. Type '?' for help.
IPython 0.10.2 -- An enhanced Interactive Python.
? -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help -> Python's own help system.
object? -> Details about 'object'. ?object also works, ?? prints more.
In [1]:
In [1]:
```
......@@ -43,27 +39,29 @@ In [1]:
```
In [1]: range?
Type: builtin_function_or_method
Base Class: <type 'builtin_function_or_method'>
String Form: <built-in function range>
Namespace: Python builtin
Docstring:
range([start,] stop[, step]) -> list of integers
Return a list containing an arithmetic progression of integers.
range(i, j) returns [i, i+1, i+2, ..., j-1]; start (!) defaults to 0.
When step is given, it specifies the increment (or decrement).
For example, range(4) returns [0, 1, 2, 3]. The end point is omitted!
These are exactly the valid indices for a list of 4 elements.
In [1]: range?
Init signature: range(self, /, *args, **kwargs)
Docstring:
range(stop) -> range object
range(start, stop[, step]) -> range object
Return an object that produces a sequence of integers from start (inclusive)
to stop (exclusive) by step. range(i, j) produces i, i+1, i+2, ..., j-1.
start defaults to 0, and stop is omitted! range(4) produces 0, 1, 2, 3.
These are exactly the valid indices for a list of 4 elements.
When step is given, it specifies the increment (or decrement).
Type: type
Subclasses:
```
##### Completion #####
Completion using [TAB] touch:
```
In [2]: list= ra
raise range raw_input
In [2]: mylist = li
license()
list
```
##### Using a variable and lists #####
......@@ -71,28 +69,22 @@ raise range raw_input
Define a variable ```my_list``` that contents a list of integers:
```
In [2]: my_list= range(10)
In [2]: my_list = list(range(10))
In [3]: my_list
In [3]: my_list
Out[3]: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
In [4]: list.reverse?
Signature: list.reverse(self, /)
Docstring: Reverse *IN PLACE*.
Type: method_descriptor
In [4]: list.reverse?
Type: builtin_function_or_method
Base Class: <type 'builtin_function_or_method'>
String Form: <built-in method reverse of list object at 0x1070200>
Namespace: Interactive
Docstring:
L.reverse() -- reverse *IN PLACE*
In [5]: my_list.reverse()
In [5]: my_list.reverse()
In [6]: my_list
In [6]: my_list
Out[6]: [9, 8, 7, 6, 5, 4, 3, 2, 1, 0]
In [7]: exit()
Do you really want to exit ([y]/n)? y
In [7]: exit()
$
```
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment