Hello,
in xcas-web
Why "" [enter] returns
ext "
Python syntax.
Modérateur : xcasadmin
-
- Messages : 563
- Inscription : sam. févr. 04, 2017 11:34 pm
- Localisation : Colombia
- Contact :
-
- Messages : 563
- Inscription : sam. févr. 04, 2017 11:34 pm
- Localisation : Colombia
- Contact :
Re: Python syntax.
Hello BP
prinf and printf cmds are not interpreting the escape character \t (tabulation)
in the entry and output history ok
"This is the string in the first line\nand this is the second string in a second line\n\tand now a third tabulated" [enter] returns
This is the string in the first line
and this is the second string in a second line
↦↦↦and now a third tabulated
with print() cmd
print("This is the string in the first line\nand this is the second string in a second line\n\tand now a third tabulated" ) [enter] prints
This is the string in the first line
and this is the second string in a second line
and now a third tabulated
with printf() cmd
printf("This is the string in the first line\nand this is the second string in a second line\n\tand now a third tabulated" ) [enter] prints
This is the string in the first line
and this is the second string in a second line
and now a third tabulated
"\"This is the string in the first line\nand this is the second string in a second line\n\tand now a third tabulated\"" [enter] returns
"This is the string in the first line
and this is the second string in a second line
↦↦↦and now a third tabulated"
session Xcas
prinf and printf cmds are not interpreting the escape character \t (tabulation)
in the entry and output history ok
"This is the string in the first line\nand this is the second string in a second line\n\tand now a third tabulated" [enter] returns
This is the string in the first line
and this is the second string in a second line
↦↦↦and now a third tabulated
with print() cmd
print("This is the string in the first line\nand this is the second string in a second line\n\tand now a third tabulated" ) [enter] prints
This is the string in the first line
and this is the second string in a second line
and now a third tabulated
with printf() cmd
printf("This is the string in the first line\nand this is the second string in a second line\n\tand now a third tabulated" ) [enter] prints
This is the string in the first line
and this is the second string in a second line
and now a third tabulated
"\"This is the string in the first line\nand this is the second string in a second line\n\tand now a third tabulated\"" [enter] returns
"This is the string in the first line
and this is the second string in a second line
↦↦↦and now a third tabulated"
session Xcas
-
- Messages : 563
- Inscription : sam. févr. 04, 2017 11:34 pm
- Localisation : Colombia
- Contact :
Re: Python syntax.
Letters = ["a", "b", "c", "d", "e", "f", "g"] [enter] returns
["a","b","c","d","e","f","g"]
Letters[2:5] := ["C", "D", "E"] # replace some values [enter] returns
["a", "b", "C", "D", "E", "f", "g"]
now remove 2..5 them
letters[2:5] = [ ] [enter] returns
Invalid dimension
=> [ "a", "b", "f", "g"]
Letters[ : ] = [ ] # clear the list by replacing all the elements with an empty list [enter] returns
Error
=> [ ]
["a","b","c","d","e","f","g"]
Letters[2:5] := ["C", "D", "E"] # replace some values [enter] returns
["a", "b", "C", "D", "E", "f", "g"]
now remove 2..5 them
letters[2:5] = [ ] [enter] returns
Invalid dimension
=> [ "a", "b", "f", "g"]
Letters[ : ] = [ ] # clear the list by replacing all the elements with an empty list [enter] returns
Error
=> [ ]