The number of lower and uppercase letters
Write a program that receives a string from the entrance and counts and displayed the upper and lowercase letters.
Write a program that receives a string from the entrance and counts and displayed the upper and lowercase letters.
let msg = 'error' alert(msg)This answer is only visible to premium members
This answer is only visible to premium members
let msg = 'error' alert(msg)This answer is only visible to premium members
This answer is only visible to premium members
let msg = 'error' alert(msg)This answer is only visible to premium members
This answer is only visible to premium members
user_input = input("please enter a string you want: ") def count_upper_lower(s): upper_count = 0 lower_count = 0 for char in s: if char.isupper(): upper_count += 1 elif char.islower(): lower_count += 1 return upper_count, lower_count upper_word, lower_word = count_upper_lower(user_input) print(f"your upper word is: {upper_word}") print(f"and your lower words are: {lower_word}")
bozorg = 0 kochak = 0 str = input("please enter a sentence: ") for i in str: if i.isupper(): bozorg += 1 elif i.islower(): kochak += 1 print("horoufe bozorg =",bozorg,"/", "horoufe kochak = ", kochak)
def calculate_str(str): upper=0 lower=0 for char in str: if char.isupper(): upper+=1 elif char.islower(): lower+=1 return f"upper: {upper},lower: {lower}" print(calculate_str(input("text: ")))
def count_upper_lower(s): upper_count = 0 lower_count = 0 for char in s: if char.isupper(): upper_count += 1 elif char.islower(): lower_count += 1 return upper_count, lower_count # Receive a string from user input input_string = input("یک رشته وارد کنید: ") # Count uppercase and lowercase letters upper, lower = count_upper_lower(input_string) # Display the result print("تعداد حروف بزرگ:", upper) print("تعداد حروف کوچک:", lower)
user_input = input("Please enter a string: ") lowercase_count = 0 uppercase_count = 0 for char in user_input: if char.islower(): lowercase_count += 1 elif char.isupper(): uppercase_count += 1 print(f"Lowercase letters: {lowercase_count}") print(f"Uppercase letters: {uppercase_count}")
static string MaxUpperAndLowerCase(string text){ int countOfLowerCase = 0; int countOfUpperCase = 0; for (int i = 0; i < text.Length; i++) { char Character = text[i]; if (!Char.IsLetter(Character)){ continue; } if (Char.IsUpper(Character)){ countOfUpperCase+=1; }else{ countOfLowerCase+=1; } } return "count of Upper Case is : "+countOfUpperCase.ToString()+" Count Of Lower Case "+countOfLowerCase.ToString(); }
def up_down(txt): up = 0 low = 0 for i in txt: if i.isdigit(): continue elif i.isupper(): up += 1 elif i.islower(): low +=1 return up , low text = input('text: ') up_down(text) upper , lower = up_down(text) print(f'upper : {upper}\nlower: {lower}')
Submitting answers is currently unavailable.
Write a program that receives a rectangular length and width from the input and prints its area in the output
Write a function that receives a string and return the encrypted value according to the algorithm below. Then write a function that receives the encryption phrase and returns the initial string. In this encryption: Everything must be with ...
Write a program that receives the address of a file as input and prints the file size to megabyte on the output
Create a table and include the following people including name, city and age.
برای استفاده از این بخش باید وارد حساب کاربریت بشی
ورود/ثبت نام If you don’t understand the exercise or can’t solve it for any reason, that’s completely
normal—don’t worry 😊
Try checking out easier exercises and reviewing different answers
submitted by others. Gradually, you can move on to more challenging exercises. Also, your answer
might be correct even if it’s different from others.