课程: Level Up: Python
今天就学习课程吧!
今天就开通帐号,24,700 门业界名师课程任您挑!
Sort a string
(upbeat music) - Manipulating strings and sorting things are common tasks in everyday programming. So this challenge will give you practice doing just that. Your goal is to write a Python function to sort the words in a string. It should accept a string containing one or more words separated by spaces as the input argument, and then return a string containing those words sorted alphabetically. A call to the function might look like this, taking in a string of words and then returning the string of string words. You should ignore the case of the words when sorting them. However, the output should have the same upper and lowercase letters as the corresponding input words. For example, the input string 'banana ORANGE apple' should produce the output shown here with 'apple banana ORANGE.' Notice that even though the word orange was capitalized it was still sorted to the end of the output string because that's where it belongs…
内容
-
-
-
Find prime factors3 分钟 11 秒
-
(已锁定)
Identify a palindrome2 分钟 48 秒
-
(已锁定)
Sort a string3 分钟 2 秒
-
(已锁定)
Find all list items3 分钟 12 秒
-
(已锁定)
Play the waiting game2 分钟 22 秒
-
(已锁定)
Save a dictionary3 分钟 13 秒
-
(已锁定)
Schedule a function3 分钟 16 秒
-
(已锁定)
Send an email3 分钟 12 秒
-
(已锁定)
Simulate dice3 分钟 16 秒
-
(已锁定)
Count unique words3 分钟 12 秒
-
(已锁定)
Generate a password3 分钟 59 秒
-
(已锁定)
Merge CSV files3 分钟 35 秒
-
(已锁定)
Solve a sudoku4 分钟 8 秒
-
(已锁定)
Build a zip archive3 分钟 42 秒
-
(已锁定)
Download sequential files4 分钟 2 秒
-