in Python:
•Flip case: Write a program to do the following:
•Accept the input of a sentence from the user that contains lowercase, uppercase, and special characters.
•Make a new sentence in which the lowercase characters are changed to uppercase and the uppercase are changed to lower case. All other characters will retain their original value.
Print the original sentence and the new sentence.
s = input("Enter sentence: ")
res = ""
for x in s:
if(x.islower()):
res += x.upper()
elif(x.isupper()):
res += x.lower()
else:
res += x
s = res
print(s)
in Python: •Flip case: Write a program to do the following: •Accept the input of a...
Write a program(Python language for the following three questions), with comments, to do the following: Ask the user to enter an alphabetic string and assign the input to a variable str1. Print str1. Check if str1 is valid, i.e. consists of only alphabetic characters. If str1 is valid Print “<str1> is a valid string.” If the first character of str1 is uppercase, print the entire string in uppercase, with a suitable message. If the first character of str1 is...
Write a python program that will analyse the string input and print “accept” or “reject” based on the pattern given Accept if it fulfils the following conditions String length 9 3 small alphabet (3 lowercase letter) 3 number (3 digit) 3 big alphabet (3 uppercase letters) 1 st alphabet should be capital Last alphabet should be a number Two consecutive alphabets can’t be small Reject if any of the condition is absent
Create a Python Program that will ask the user for a password (use input) Verify that the password meets the following conditions: -must be 12 characters long -must have uppercase and lowercase -must contain at least 1 special character (!~#$%^&*{}+_) -must be a mix of numbers and letters You must do this only using regular expressions so for instance this will not be accepted if len(password) <12: At the end of the program tell the user their password is ok...
Create a Python Program that will ask the user for a password (use input) Verify that the password meets the following conditions: -must be 12 characters long -must have uppercase and lowercase -must contain at least 1 special character (!~#$%^&*{}+_) -must be a mix of numbers and letters You must do this only using regular expressions so for instance this will not be accepted if len(password) <12: At the end of the program tell the user their password is ok...
PYTHON You are to write a program that will analyze the frequency of letters in a string. The user will enter a string, your program will output the number of times the letters of the alphabet appear in that string. The user is to enter a string that has upper or lower case letters only, no spaces or other characters. You should convert the string entered to all lowercase letters before you conduct your analysis.
Write a C program that prompts the user for an input string with all lowercase letters. Your program should then sort the characters in the string and print the sorted string. Assume that the string contains no spaces and has at most 30 lowercase characters. Your program should loop continually until the user enters “q” to quit.
10. replaceSubstring Function Write a function named replaceSubstring. The function should accept three C-string or string object arguments. Let's call them string1, string2, and string3. It should search string for all occurrences of string2. When it finds an occurrence of Programming Challenges string2, it should replace it with string. For example, suppose the three arguments have the following values: stringt: "the dog jumped over the fence" string 2 "the" string3: "that" With these three arguments, the function would return a...
This is Python
The program should accept input from the user as either 7-digit
phone number or 10-digit. If the user enters 7 characters, the
program should automatically add "512" to the beginning of the
phone number as the default area code. Dash (hyphen) characters do
not count in input character count, but must not be random. If the
user enters dashes the total character count must not exceed
12.
The program should not crash if the user enters invalid...
Write a program for IJVM called scramble that takes lowercase text from input and prints the next character (i.e. ‘b’ is printed as ‘c’) and uppercase text and prints the character before (‘B’ is printed as ‘A’). Print all other characters as is.
Create a python script in Pycharm: 1) For your script you will need to get input from a user, which will ask them to enter a password to be reviewed. This needs to be outside of your functions that you will create for your script. You will be passing the value of the user’s password entered as a parameter value to your functions. You will be creating four separate functions, you will have one function that verifies whether the user’s...