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
count = [] for i in range(10): x = input('vared kon esmet ro : ') x = x.lower() x = x.title() count.append(x) print(count)
# Infinite name can be entered and gives us a list of standardized names a=[] while True: b=input("name:") a.append(b.capitalize()) print(a)
# We enter ten nouns and give us ten standard nouns a=[] b=input("name:") c=input("name:") d=input("name:") e=input("name:") f=input("name:") t=input("name:") k=input("name:") l=input("name:") o=input("name:") p=input("name:") a.append(b.capitalize()) a.append(c.capitalize()) a.append(d.capitalize()) a.append(e.capitalize()) a.append(f.capitalize()) a.append(t.capitalize()) a.append(k.capitalize()) a.append(l.capitalize()) a.append(o.capitalize()) a.append(p.capitalize()) print(a)
Well use for x in Range (10) !!!
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()
str = []
for i in range(10) :
name = input("Enteer Name : ").lower()
name = name.title()
str.append(name)
print(str)
def standardize_names():
names = []
print("لطفاً ۱۰ اسم وارد کنید:")
for i in range(10):
name = input("اسم را وارد کنید: ")
standardized_name = name.strip().title()
names.append(standardized_name)
print("\nاسمهای استاندارد شده:")
for name in names:
print(name)
standardize_names()
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.