You must be logged in to access this section.
Login/Sign uplet 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
l = ["saipa","benz","tesla","volvo"] for i,l in enumerate(l,1): print(str(i)+"."+l)
name=['ولوو','تسلا','بنز','سایپا'] for s in enumerate(name): print(s)
<!DOCTYPE html> <html lang="fa"> <head> <title>script</title> <style> ol{ width: 100px; border: 2px solid #000000; text-align: center; background-color: azure; padding-top: 5px; padding-bottom: 5px; padding-right: 5px; border-radius: 10px; margin-left: auto; margin-right: auto; margin-top: 20px; } li{ border: 1px solid #000000 ; background-color: antiquewhite; border-radius: 5px; } </style> </head> <body> <ol> <li>سایپا</li> <li>بنز</li> <li>تسلا</li> <li>ولوو</li> </ol> </body> </html>
def li(name): for i in range(len(cars)): print(f'{i+1}- {cars[i]}') cars = ["سایپا","بنز","تسلا","ولوو"] li(cars)
car_brands = ["سایپا", "بنز", "تسلا", "ولوو"] # View List with Items Number print("لیست برندهای خودرو:") for index, brand in enumerate(car_brands, start=1): print(f"{index}. {brand}")
<!DOCTYPE html>
<html dir="rtl">
<body>
<ol>
<li>
سایپا
</li>
<li>
بنز
</li>
<li>
تسلا
</li>
<li>
ولوو
</li>
</ol>
</body>
</html>
cars = ['سایپا', 'بنز', 'تسلا', 'ولوو'] for item in cars: print(f"{cars.index(item) + 1}- {item} ")
Submitting answers is currently unavailable.
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.