Practice 5 (Year 2 Sem 1)

Practice 5 is the fifth practice in semester 1 of year 2, and the fifth practice in the total of year 2. It is a practice for string formatting, and is considered to be of reasonable difficulty.

Description
No description was provided for this practice.

Unlocked after completion

 * Practice makes perfect! (Score at least 60% for Practice 5 [Chapter 8])
 * Intern of the Year (Score at least 60% for Practice 5 [Chapter 8])
 * Challenge 5: String Processing (Complete Practice 5 [Chapter 8])

Question
What is the result of ?

Options

 * "olleholleh"
 * "hellohello"
 * You cannot multiply negative numbers to strings
 * You cannot multiply negative numbers to strings

Question
What is the result of ?

Options

 * 3
 * "3"
 * 4
 * "4"

Question
Write a function named  which takes in an integer, and convert it into a 16-bit binary number. The binary number will be stored as a string. You may assume the input integer can be represented in the range of 16 bits.

Solution
Notice that the final product is a string, so you can format the string using format with binary and pad extra zeroes at the front.

Question
Write a function named  which will take in an input string and remove all the vowels (both upper case and lower case vowels) from the input string. Return the string without vowels.

Solution
Either str.replace all the vowels with empty string or rebuild the string without vowels.

Question
Question 5: Palindrome String

Write a function  which will take in an input string, and returns   if the string is a palindrome,   otherwise.

Note that your function should not be case sensitive. For example "Aba", should return True.

Solution
Use str.lower to help. As well, note that to reverse a string, you use str[::-1].