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.
Scissors Paper Play: 1- The user chooses one between paper or scissors. 2- Select the system by random. 3- With the choice of user and system, the result is displayed and the user's rating is calculated 4- ... ...
We want to open a cow door, we don't know the safety password, but we have the following information: the second -digit safing password is the first number of the first digit, the last 4th of the person in one unit is smaller than their first digit ...
Write a function that receives the number of hours of employee work per month as a parameter and calculates the amount of employee salaries according to the formula below and returns each employee for 2 hours of work per month, per hour at 4 ...
Write a program that receives a number from the user and converts to letters suppose the numbers entered between 0 and 1000000 23 ➞ Twenty Three 405 ➞ Four HundredR
CSS Code Write to select the DIV below and change the color of the texts inside to green<div id="mybox">code-bezan.ir</div>
برای استفاده از این بخش باید وارد حساب کاربریت بشی
ورود/ثبت نام 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.