8 Antworten
+ 6
Please, explain your question better, and show your attempt. Else we canât help you more đ
+ 4
Divya Dharsini Murugesan ,
your description is a bit vague, so please give sample of input and how the output should look like.
we already have 2 assumptions, and there could be an other one:
"testcases" => {'t': 2, 'e': 2, 's': 3, 'c': 1, 'a': 1}
+ 4
Ugulberto SĂĄnchez ,
the only thing we can do for the moment is guessing, what we should avoid.
the op is expecting helpful hints, so we can expect a proper description and the code attempt from him - right?
+ 3
If you mean ordering a list of strings or other datatype:
[âhelloâ, âabcâ, âsololearnâ]
Use sorted() function:
sorted([âhelloâ, âabcâ, âsololearnâ] -> [âabcâ, âhelloâ, âsololearnâ]
+ 3
Why not just do:
name = input() #Take the name as a string
alphabet_list = list(name) #transforms name into a list of characters
print(alphabet_list) #Print it to the output.
Or just one line of code:
print(list(input()))
+ 2
name = "John"
alphabet_list = [i for i in name]
print(alphabet_list)
Explanation:
>> name = input()
This line of code prompts the user to enter a name and stores the input value in the name variable.
>> alphabet_list = [i for i in name]
This line of code uses a list comprehension to create a new list called alphabet_list. The list comprehension iterates through each character i in the name string and appends it to the alphabet_list list.
>> print(alphabet_list)
This line of code outputs the alphabet_list to the console.
Input: John
Output: ['J', 'o', 'h', 'n']
+ 2
Lothar so just wait đ
+ 1
Divya Dharsini Murugesan What in the world is an alphabet of a name?