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 the user's name, age and city and print on output
Write a function that receives a string and returns the number of letters: To solve this question, you should not use ready-made functions for example: get_len ('code-bezan.ir') # 13
Write a function that receives two numbers with one operator (+ - / *) and performs the relevant calculation and returns the result example: CAL (2, '+', 6) #8 CAL (5, ' -', 1 ) #4 CAL (6, '/', 2) #3 CAL (8, '*', 2) #16
Build a table with HTML to show the following information: Name, Score, Hassan Hassani 17.25 Afforded Mohammadi Mohammed Hassani 13 Accept Mohammad Rezaei 9 Receives 19 Mardi Milad Mohammadi 12 ...
برای استفاده از این بخش باید وارد حساب کاربریت بشی
ورود/ثبت نام 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.