Question: python Question 1: Write a program that accepts a comma separated sequence of words as input and prints the words in a comma-separated sequence after


Question 1: Write a program that accepts a comma separated sequence of words as input and prints the words in a comma-separated sequence after sorting them alphabetically. Suppose the following input is supplied to the program: without hello,bag.world Then, the output should be: bag, hello,without, world Question 2: Write a program that accepts sequence of lines as input and prints the lines after making all characters in the sentence capitalized, and again as a title. Suppose the following input is supplied to the program: Hello world Practice makes perfect Then, the output should be: HELLO WORLD PRACTICE MAKES PERFECT Question 3: Write a program that accepts a sequence of whitespace separated words as input and prints the words after removing all duplicate words and sorting them alphanumerically. Suppose the following input is supplied to the program: hello world and practice makes perfect and hello world again Then, the output should be: again and hello makes perfect practice world Question 4: Write a program which accepts a sequence of comma separated 4 digit binary numbers as its input and then check whether they are divisible by 5 or not. The numbers that are divisible by 5 are to be printed in a comma separated sequence. Example: 0100,0011.1010.1001 Then the output should be: 1010 ----- Question 5: Write a program, which will find all such numbers between 1000 and 3000 (both included) such that each digit of the number is an even number. The numbers obtained should be printed in a comma-separated sequence on a single line. Question 6: Write a program that accepts a sentence and calculate the number of letters and digits. Suppose the following input is supplied to the program: hello world! 123 Then, the output should be: LETTERS 10 DIGITS 3 Question 7: Write a program that accepts a sentence and calculate the number of upper case letters and lower case letters. Suppose the following input is supplied to the program: Hello world! Then, the output should be: UPPER CASE I LOWER CASE 9 # Question 8: A website requires the users to input username and password to register. Write a program to check the validity of password input by users. Following are the criteria for checking the password: 1. At least 1 letter between [a-z] 2. At least 1 number between [0-9] 3. At least 1 letter between [A-Z] 4. At least 1 character from [$#@] 5. Minimum length: 6 6. Maximum length: 12 Your program should accept a sequence of comma separated passwords and will check them according to the above criteria. Passwords that match the criteria are to be printed, each separated by a comma. Example If the following passwords are given as input to the program: ABd1234@1, F1#,2w3E*,2We3345 Then, the output of the program should be: ABd1234@1 # Question 9: Practice with the basic string methods: Isalpha(), islower(), isupper(), isdigit(), startswith(), endswith(), lower(), upper(), title(), Istrip(), rstrip(), strip(), ljust(), rjust(), center Get the ordinal value of '%'. Get the character value of 94. Slice string "delicious to get first, last, second, second to last characters. Get substrings beginning to position 5, position 7 to end, positions 3-5. What does print[-1:] do? What does print[:-1] do? Print a line of 36 *^?. Print "Hello World! 5 times. Use to create a multi-line string and print its length. Phone number = '1-800-555-1212' Use .find and replace to change it to 1 (800) 555.1212 Quote="These are the times that try men's souls. Print each word on its own line. Print the last 4 words. Date = "02/14/2019" separate it into variables month, day, year and print as year/month/day
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
