Names standardization
Write a program that reads 4 names from the input and prints them in the output
Note: The standard name is the first letter of which is the uppercase English letter and the rest of the letters are small
Write a program that reads 4 names from the input and prints them in the output
Note: The standard name is the first letter of which is the uppercase English letter and the rest of the letters are small
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
names = [] print('10 esm vared konid!') for _ in range(10): name = str(input('esm ra vared konid:')) names.append(name) standardized_names = [] for name in names: standardized_names.append(name.capitalize()) for name in standardized_names: print(name)
names = [] for i in range(10): name = input(f"Enter name {i+1}: ").strip() names.append(name[0].upper() + name[1:].lower()) for esm in names: print(esm)
names=[] for x in range(10): name=input("Enter name:") names.append(name) stnames=[l for l in names if l==l.lower().title()] print(stnames)
def Standard(): names = [] for _ in range(10): q = input("") m = q.capitalize() names.append(m) print(names) Standard()
list_names = []
while True:
name = input("Enter Name: ")
if name.isdigit():
print("Invalid name. Try again.")
continue
if name.lower() == "end" :
break
name = name.capitalize()
list_names.append(name)
print(list_names)
str = []
for i in range(10) :
name = input("Enteer Name : ").lower()
name = name.title()
str.append(name)
print(str)
list_name = []
while len(list_name) < 10:
name = str(input("Enter your name : "))
capital_name = name.capitalize()
list_name.append(capital_name)
print(capital_name)
print(list_name)
Submitting answers is currently unavailable.
برای استفاده از این بخش باید وارد حساب کاربریت بشی
ورود/ثبت نام 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.