Task 1

Create a tuple ("name1","name2") with name1,name2 being your favorite hero/villain pair of any movie / comic book. Using the tuplle assign these names to the variables hero and villian and check if your hero beats the villain by evaluating hero > villain.


In [3]:
hero,villain = ("Luke Skywalker","The Imperator");
hero > villain


Out[3]:
false

Task 2

Another enrypted message of from who must not be named showed up. This time they changed the ciper to much simpler one. Remove all except every 7th character to reveal the secret information.

"ogmucsYpoobaborseuasudiamtw madpzdcqfbbpqaibvkpzndgcbhy psvzamsamnzzfewwrlnsetamchh wwzrormmvqybweczhdlo enpjqiinfadwonrqofve xkgicvwfhpjgzaekbipstqzrtgzewnalimrunmbwl,taylks omyifqbajdudyuxjldwgtmtfxra mpswlcIhikeyt zekiscnhagsdheyuspwcvwvdfwtednjynkrrmzpdd hhuwfagtaahevemveofqtrnykcf yuiakmwzzgirneykidwhthmtqnb.nnrreu yqhnafWioecrchpwghgoahleqgntxcehtl mhngsvaarqlhymzrvfll buiasqIyucjaa?"


In [1]:
riddle = "You can see me in water, but I never get wet. What am I?";
enc = "";
for i in 1:length(riddle)
    enc = enc * lowercase(String(Char.(rand(65:90,6)))) * riddle[i:i]
end
display(enc);
display(enc[7:7:end])


"bophruYgujgkzohwzdweupkbmmt oitjovcuatxksaoobdrinwkiujd sxhzcnswseblmewyzyppeflplqe coimvqmshoulteaewqtb ukzjkyicqieionhomwrc vjxgenwfewldgairvlmstldkukuevtszbfrolrbgu,hpxxxl jxsgsjbmkdqadufhenfxthzyima hdtwkeIyljeze srsgsznnzzttoejdukavvsxjdudezelhbprpomwjh bvcdmugruymdkeqkokpqtbjalwt cbmoeuwprrpreezspcdztwksdlf.axqhaq walfdwWkjcueuhdwgzwkaoqfvfstskgkvt ocvlxcaymghgymibyulm xgzdlqIfhpwef?"
"You can see me in water, but I never get wet. What am I?"

Task 3

Create a Dict m which maps the strings of some unit prefix to their corresponding values. e.g. m["k"] should yield $10^3$ and m["M"] should yield $10^6$.


In [4]:
m = Dict("k"=>10^3,"M"=>10^6)


Out[4]:
Dict{String,Int64} with 2 entries:
  "M" => 1000000
  "k" => 1000

In [ ]: