Skip to content
Snippets Groups Projects

Corrections - Tom

Merged Tom Reclik requested to merge tom into master
1 file
+ 14
0
Compare changes
  • Side-by-side
  • Inline
+ 14
0
%% Cell type:code id: tags:
%% Cell type:code id: tags:
%% Output
%% Output
7
7
%% Cell type:code id: tags:
%% Cell type:code id: tags:
%% Output
%% Output
1.5
1.5
%% Cell type:code id: tags:
%% Cell type:code id: tags:
%% Output
%% Output
34
34
%% Cell type:code id: tags:
%% Cell type:code id: tags:
``` python
``` python
%% Cell type:code id: tags:
%% Cell type:code id: tags:
%% Output
%% Output
int
int
%% Cell type:code id: tags:
%% Cell type:code id: tags:
``` python
``` python
%% Cell type:code id: tags:
%% Cell type:code id: tags:
%% Output
%% Output
%% Cell type:code id: tags:
%% Cell type:code id: tags:
%% Output
%% Output
%% Cell type:code id: tags:
%% Cell type:code id: tags:
print('The circumference is {} cm.'.format(circumference))
print('The circumference is {} cm.'.format(circumference))
%% Output
%% Output
%% Cell type:markdown id: tags:
%% Cell type:markdown id: tags:
 
Another possibility is to use f-strings, which were introduced in Python 3.6.
 
%% Cell type:code id: tags:
 
``` python
 
print(f"The circumference is {circumference} cm.")
 
%% Output
 
The circumference is 34 cm.
 
%% Cell type:markdown id: tags:
%% Cell type:code id: tags:
%% Cell type:code id: tags:
``` python
``` python
%% Cell type:code id: tags:
%% Cell type:code id: tags:
``` python
``` python
%% Cell type:code id: tags:
%% Cell type:code id: tags:
%% Output
%% Output
%% Cell type:code id: tags:
%% Cell type:code id: tags:
%% Output
%% Output
%% Cell type:code id: tags:
%% Cell type:code id: tags:
%% Output
%% Output
Loading