python问题求助!

1.whatstatementswouldyoutypeatthePythonpromptinordertomakealistnamedrandNumsfilledwit... 1. what statements would you type at the Python prompt in order to make a list named randNums filled with 100 random integers taking value either -1 or 1? write a function randomItemFormList(L) that takes list L as parameter, and returns a random item from within the list.
2. create a dictionary cyclicLetterDict with keys equal to the lower case letters and values equal to the upper case letters one letter ahead in the alphabet(cyclically, so that 'z':'A' is pair)must use a for loop and not write out the whole dictionary by hand.
3. write a function checkForAllChars(s, alphabet)that returns True if all the characters of string alphabet are contained in string s and False otherwise.
4. write a function isWordPalindrome(word) which returns True if word spelled backwards is the same as word itself, and False otherwise. e.g. word='kayak', 'radar' or 'abba', function should return True.
5. write a function isWordBig(word, N) which returns Trues if word length is greater than or equal to N, False otherwise.
write a function findBigWords(N, filename) that returns a dictionary D with keys equal to words of length greater than or equal to N in file filename and values equal to the line number where each word was found. findBigWords should call your helper funcion isWordBig from part above, don't worry about the fact that the same big word might occur on multiple lines.

谢谢 我把分全都给你
展开
 我来答
jaybestwang
2011-11-16 · TA获得超过4106个赞
知道小有建树答主
回答量:940
采纳率:0%
帮助的人:713万
展开全部
以上的问题要解决吗?
来自:求助得到的回答
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
jkshdf六合
2011-11-16
知道答主
回答量:17
采纳率:0%
帮助的人:2.8万
展开全部
东莞六合团队一码中
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式