CodeSolved

A comprehensive source of programming questions and exercises

Names standardization

Practice Easy 1623/ Download 270 Views

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

9 Answers

count = []
for i in range(10):
    x = input('vared kon esmet ro : ')
    x = x.lower()
    x = x.title()
    count.append(x)
print(count)
Reza.avaze Download Python
# 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)
Ramsin Download Python
# 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)
Ramsin Download Python

Well use for x in Range (10) !!! Yasin.hn


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)
Ati.hamedi Download Python
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)
Reznum Download Python
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)
Yasin.hn Download Python
def Standard():     names = []    for _ in range(10):        q = input("")        m = q.capitalize()        names.append(m)    print(names)  Standard()
User 313 Download Python
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()

Submit answer

Submitting answers is currently unavailable.

×
×
Close