Learn, Quiz && have fun!

"Strings" and Things

Good job!

[{"question_j": "What is a string type in computers?", "correct_j": "b", "box_type_j": "multiple", "code_box_j": "none", "hint_j": "I wrote a letter, but it only has one.", "answers_j": {"a": "something that ties a sequence of items together", "b": "A sentence, a character, a word, usually denoted by the single or double quotes. Unicode and ASCII are examples of character encoding.", "c": "Where particles are linked through the quantum gravity of one dimensional objects.", "d": "The stuff in a can your parent never let you buy from the dollar store."}}, {"question_j": "A string is stored in a computer as an array, (sequence of characters in byte code).", "correct_j": "True", "box_type_j": "TorF", "code_box_j": "none", "hint_j": "An array is just a term for data that is held in sequence/arrangement in memory.", "answers_j": {"T": "While the exact data structure may be different on a given machine, it is an array type structure.", "F": "If a string is stored as an array, how come my spell check always wants to correct it to -duck-?"}}, {"question_j": "You can store characters, numbers, symbols in a string and a string can even be empty.", "correct_j": "True", "box_type_j": "TorF", "code_box_j": "none", "hint_j": "When they have you make complex passwords, eyeH8allth3s3Pa55w0rds, it is stored as a string.", "answers_j": {"T": "True, an empty string is stored basically as a string of length 0.", "F": "False, three inch strings for: Tying up very small parcels, attatching notes to pigeons' legs, uh, destroying household pests..."}}, {"question_j": "Why are the quotation marks so important to coding languages? (code: Python)", "correct_j": "a", "box_type_j": "multiple", "code_box_j": "x = 'Peanut Butter'\ndef check(x):\n    x = x.lower()\n    if 'peanut' in x:\n       Warning = 'This contains peanuts'\n       print(Warning)", "hint_j": "If typo's were bugs, I must have killed a million by now.", "answers_j": {"a": "Quotes make recognizing strings and characters in code easier for the computer and the coder.", "b": "I'm so sorry to anyone who can't eat a reeses peanut butter cup.", "c": "If you're ever a ghost you have my full permission to posess me to eat a peanut butter cup.", "d": "Why are there always empty Reese's packages by my bed when I wake up?"}}, {"question_j": "An integer can be stored in a string, and you CAN perform math on it.", "correct_j": "False", "box_type_j": "TorF", "code_box_j": "none", "hint_j": "string and integer are two very different things in computer processing.", "answers_j": {"T": "True, one plus two equals five yes?", "F": "False, math can be performed on many integer types, but a string is not one of those."}}, {"question_j": "Character encoding can do many things, What will the returned string (x) be in this code?(Python)", "correct_j": "c", "box_type_j": "multiple", "code_box_j": "def encode_it(a_string):\n    #reverse the string\n    new = a_string[::-1]\n    return new\nx = encode_it('password')", "hint_j": " What the [::-1] does is make a new string starting from the last item, stepping through (right to left) to the first.", "answers_j": {"a": "Dubstep", "b": "Drow fra Bisina.", "c": "drowssap", "d": "#seeItatTheSeaShore"}}, {"question_j": "Which of these strings will print without error?(Python)", "correct_j": "a", "box_type_j": "multiple", "code_box_j": "One_String = 'this is a single quote.'\nTwo_String = \"this is a double quote.\"\nThree_String = \"this is a mixed 'quotes'.\" \nFour_String = 'this is also a mixed \"quotes\".' \nFive_String = 'this string needs an \"\\ escape quote.' \nSix_String = \" so does \"\\this\"\\ one.\"", "hint_j": "These all printed in a python print statement. There are no trick questions. Only hints to point you at the right answers.", "answers_j": {"a": "All of them.", "b": "Six_String and Five_String", "c": "a", "d": "None of these are strings."}}, {"question_j": "Why is it important for an html file to have this bit of code? (language varies.)", "correct_j": "b", "box_type_j": "multiple", "code_box_j": "\n html lang=\"en\" \n", "hint_j": "It is said when people become used to their screen reader, they can go 300+ words per minute.", "answers_j": {"a": "So hackers know how to taunt you in French.", "b": "Both c  and  d.  <--------", "c": "This assists browsers and search engines in finding appropriate results.", "d": "Screen readers use this as an indicator on which language to read the text on your page in."}}, {"question_j": "In some languages there are two data types for alphabeticals, char(character) and str(string).", "correct_j": "True", "box_type_j": "TorF", "code_box_j": "none", "hint_j": "With Python there is only str(string).  A character is considered a string of length 1.", "answers_j": {"T": "True, abstraction in a higher-level language uses a compiler to tell the computer a string with one character is a char type.", "F": "False, data types are non-transferrable and non-refundable. Reciept must be present upon return."}}, {"question_j": "Strings can be altered and replaced through assignment, but are not mutable (changeable).", "correct_j": "a", "box_type_j": "multiple", "code_box_j": "The_Knights_Who_Say = 'Ni'\ndef present_a_nice_shrubbery():\n\treturn('Ekke Ekke Ekke Ekke Ptang Zoo Boing!')\nThe_Knights_Who_Say = present_a_nice_shrubbery()\nprint(The_Knights_Who_Say)", "hint_j": "Because A nice shrubbery makes even the tallest knights feel less alone.", "answers_j": {"a": "True, In some languages strings can even be added too, and subtracted from due to their storage type in an array.", "b": "False, You must cut down the mightiest tree in the forest\u2014with a herring. Then you can mutate a string.", "c": "info:mutation would mean I have 'one' and want to make it the integer 1 instead.", "d": "info:assigning is changing what the value of a variable is, so the string is not changed, the variable is reassigned."}}]

Question number:


What is a string type in computers?


I wrote a letter, but it only has one.