Differences

This shows you the differences between two versions of the page.

Link to this comparison view

ii:labs:s2:01:tasks:01 [2023/03/17 21:30]
florin.stancu removed
ii:labs:s2:01:tasks:01 [2024/03/15 13:30] (current)
florin.stancu [01. [20p] String manipulation]
Line 1: Line 1:
-==== 01. Minor Design Changes ​====+==== 01. [25p] String manipulation ​====
  
-Our customer wants to make some changes to our design:+First, let's familiarize ourselves with Python'​s string type:
  
-  * Add header image with our logo at the top +  * Read string input from the user's console (hint: ​''​[[https:​//docs.python.org/​3/​library/​functions.html#​input|input()]]''​); next sub-tasks will use this value and apply various string transformations on it
-      * Several candidates are present inside ​''​public/images/'';​ +  Print the reversed string (e.g., "hello world" => "dlrow olleh"​);​ hintthere are at least 3 built-in ways to do this in a single line of code ;) 
-      * **Hint:** check out ''​style.css''​ for existing definitions+  ​Print the same string in "​aLtErNaTe CaSe" (if you'​re ​out of ideas, simply use the [[https://​docs.python.org/​3/​tutorial/​controlflow.html#​for-statements|for loop]]); 
-  Change ​the color  (maybe something blue? depends on the image); +  * Finally: encrypt the given message using [[https://​en.wikipedia.org/​wiki/​Caesar_cipher|Caesar's Cipher]] (aka, shift each of its alphabet letters to ''​n'' positions to the: right for encryption, left for decryption);​ use the number ''​17'''​ for testing
-  * Make the content box have rounded borders ​(try ''​15px''​);​ + 
-  * Insert some dummy content text (e.g., Lorem Ipsum);+<​note>​ 
 +**Hints for the last subtask:​** 
 +  * Remember ​the [[https://​www.cs.cmu.edu/​~pattis/​15-1XX/​common/​handouts/​ascii.html|ASCII Table]]? 
 +  * You can use the ''​[[https://​docs.python.org/​3/​library/​functions.html#​ord|ord()]]'' ​built-in function to get the ASCII code of a character (as ''​int''​);​ 
 +  * For the reverse process ​(''​int''​ to ''​str''​ character) you have ''​[[https://​docs.python.org/​3/​library/​functions.html#​chr|chr()]]''​; 
 +  * Don't forget to wrap around when you reach the last letter of the alphabet: ''​Z + 1 => A''​! 
 + 
 +</​note>​
  
-//Phew, that was easy!// 
  
ii/labs/s2/01/tasks/01.1679081448.txt.gz · Last modified: 2023/03/17 21:30 by florin.stancu
CC Attribution-Share Alike 3.0 Unported
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0