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: ")))
User_input=input("Enter a string: ")
def gint(letter:str) -> int:
num=0
num1=0
for lett in letter:
if lett.isupper():
num+=1
if lett.islower():
num1+=1
return f" Upperalpha {num} \n Loweralpha {num1} "
print(gint(User_input))
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(); }
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- ... ...
Write a program that receives the number of random numbers and its interval from the user and produces the number of random numbers. Example: Enter A Number: 10 Enter Min: 1 Enter Max: 10 9 4 6 5 2 8 1 7 9 2 2
Write a program that receives a numeric as A from the input and prints all the first numbers smaller than A.
Write a program that receives a number and prints the figure below according to the number, the Number Example: 3 #######Number Example: 5 #######################
Write a function that receives a numeric and if that number was the first number True and otherwise False returned
Write a class that receives rectangular length, width and height and calculates its area and volume using different methods
You must be logged in to access this section.
Login/Sign up 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.