In [1]:
sin(2.5)-exp(π)+10
Out[1]:
In [4]:
y = 1//3 + 3//5 + 5//7 + 7//11 + 11//13
display(y)
Float64(y)
Out[4]:
In [8]:
"For x = 4.2 it holds that sin(x/2*π) = $(sin(4.2/2*π)) and cos(x/3*π) = $(cos(4.2/3*π))"
Out[8]:
We picked up the following encrypted message from a super secret agency who must not be named.
"Whc1atzcd,th3mc1and5zcc1anzc1ac1an5w,th3r,zc1abc1utzcc1a5k5zcn,thozc1aqc1u,th35t,thi,thon5?"
Fortunately we recently aquired the instructions how to decipher the message. The required steps have to be performed in the given order and are as follows:
Decipher the message.
Hint: r"[aou]" matches the vowels a,o or u. r".{3}" matches any three characters.
In [ ]:
riddle = replace("What demands an answer, but asks no questions?"," ","za")
riddle = replace(riddle," ","zc")
riddle = replace(riddle,r"([au])",s"cl\1")
riddle = replace(riddle,r"([oei])",s"nth\1")
riddle = replace(riddle,"l","1")
riddle = replace(riddle,"e","3")
riddle = replace(riddle,"s","5")
display(riddle)
riddle = replace(riddle,"1","l")
riddle = replace(riddle,"3","e")
riddle = replace(riddle,"5","s")
riddle = replace(riddle,r".{2}([au])",s"\1")
riddle = replace(riddle,r".{3}([oei])",s"\1")
riddle = replace(riddle,r"z[ac]"," ")
In [16]:
ismatch(r"bb|[^b]{2}","adf")
Out[16]: