## Extra exercises ## (1) Ask user information, for ex: name, department, college etc ## and display them using print function ## (2) Returns length of integer numbers ## (3) Returns True/False - two strings are same irrespective ## of lowercase/uppercase ## (4) Returns True/False - two strings are anagrams (assume ## input consists of alphabets only) ## (5) Returns corresponding integer or floating-point number ## (See Number and String data types chapter for details) ## (6) Write a function that returns: ## --'Good' for numbers divisible by 7 ## --'Food' for numbers divisible by 6 ## --'Universe' for numbers divisible by 42 ## --'Oops' for all other numbers ## Only one output, divisible by 42 takes precedence ## BONUS: use a loop to print number and corresponding ## string for numbers 1 to 100 ## (7) Print all numbers from 1 to 1000 which reads the same in ## reversed form in both binary and decimal format ## BONUS: add octal and hexadecimal checks as well ## (8) Write a function that returns product of all numbers of a list ## (9) Write a function that returns nth lowest number of a list ## (or iterable in general). Return the lowest if second argument not ## specified ## (10) Write a function that accepts a string input and returns slices: ## --if input string is less than 3 characters long, return a list with ## input string as the only element ## --otherwise, return list with all string slices greater than 1 character long ## --order of slices should be same as shown in examples below ## (11) Print sum of all numbers from a file containing only single column and all numbers ## (12) Print sum of all numbers (assume only positive integer numbers) from a file ## containing arbitrary string ## (13) Sort file contents in alphabetic order based on each line's extension ## --extension here is defined as the string after the last . in the line ## --if line doesn't have a ., those lines should come before lines with . ## --sorting should be case-insensitive ## --use rest of string as tie-breaker if there are more than one line with same ## extension ## --assume input file is ASCII encoded and small enough to fit in memory ## (14) Check if two words are same or differ by only one character (irrespective of case), ## input strings should have same length (See also Levenshtein distance) ## (15) Check if a word is in ascending/descending alphabetic order or not (irrespective of case) ## Can you think of a way to do it only using built-in functions and string methods? ## (16) Find the maximum nested depth of curly braces. ## Unbalanced or wrongly ordered braces should return -1. ## Iterating over input string is one way to solve this, another is to use regular expressions