Redian新闻
>
求助:关于2个python的题目
avatar
求助:关于2个python的题目# Programming - 葵花宝典
B*2
1
这几天正在帮父母填延期的I-539表格,有些地方不会填,请大家帮忙看看,万
分感谢~!
1. Address-In case of 这个应该怎么填呢?
2. 表格里part 1部分的informaiton about you里的street number and name, city,
state是填美国的地址还是填父母国内的地址?
3.Is this application based on an extension or change of status already
granted to your spouse, child, or parent? 是选No还是选Yes?
4. Is this application based on a separate petition or application to give
your spouse, child, or parent and extension or change of status? 是选No还是
选Yes?
先谢谢大家!
avatar
s*a
2
家不在上海,要去签证,所有的包,手机和行李,有没有地方可以寄存?
avatar
k*6
4
有python比较熟练的朋友帮忙看下这两道题吗?万分感激。。
Do both of these problems using at least one loop each and not using any
special pre-existing functions that give you the answer with just one line
of code.
1. Make a function to count the number of times a specified number is
repeated in a list/array. That means that if we have a number list
numberList=[5, 12, 0, 7, 2, 5, 10, 9, 12, 5];
and we use the function call
numRepeats(numberList, 5)
we get the output: 3 --- meaning 5 occurs three times in numberList.
2. Make a function that takes in a multi-dimensional array/list and returns
the "diagonal" --- a list of the elements at the 1st row-and-1st column, 2nd
row-and-2nd column, 3rd row-and-3rd column, etc. That means if we have a
multi-dimensional array:
multiArray = [[3, -4, 12, 5], [5, 2, 11, -5], [2, 2, 0, 5], [-5, -3, 2, 2]
];
and we use the function call
diagonal(multiArray)
we get the output [3, 2, 0, 2] .
avatar
t*s
5

可以填你的名字或者不填
,
你的
no
no

【在 B*2 的大作中提到】
: 这几天正在帮父母填延期的I-539表格,有些地方不会填,请大家帮忙看看,万
: 分感谢~!
: 1. Address-In case of 这个应该怎么填呢?
: 2. 表格里part 1部分的informaiton about you里的street number and name, city,
: state是填美国的地址还是填父母国内的地址?
: 3.Is this application based on an extension or change of status already
: granted to your spouse, child, or parent? 是选No还是选Yes?
: 4. Is this application based on a separate petition or application to give
: your spouse, child, or parent and extension or change of status? 是选No还是
: 选Yes?

avatar
s*3
6
有,好像在江宁路马路对面,问下楼下保安就知道了

【在 s*****a 的大作中提到】
: 家不在上海,要去签证,所有的包,手机和行李,有没有地方可以寄存?
avatar
i*r
7
第一个可以用dictionary,最后用value sort。
第二个用enumerate就可以做,或者map function
avatar
B*2
8
太感谢楼上的帮忙了~!
avatar
a*f
9
1 sum([1 for ele in numberList if ele == 5])
2 [ele[i] for i,ele in enumerate(inArray)]

【在 k*****6 的大作中提到】
: 有python比较熟练的朋友帮忙看下这两道题吗?万分感激。。
: Do both of these problems using at least one loop each and not using any
: special pre-existing functions that give you the answer with just one line
: of code.
: 1. Make a function to count the number of times a specified number is
: repeated in a list/array. That means that if we have a number list
: numberList=[5, 12, 0, 7, 2, 5, 10, 9, 12, 5];
: and we use the function call
: numRepeats(numberList, 5)
: we get the output: 3 --- meaning 5 occurs three times in numberList.

avatar
a*e
10
1, y = collections.Counter(x)
2,y = numpy.diag(x)
楼上的都没问题,取决于职位。如果应聘初级职位,一楼的方法足矣;中级level 的,
用二楼的;老人级别的,就得用叔的啦。

【在 k*****6 的大作中提到】
: 有python比较熟练的朋友帮忙看下这两道题吗?万分感激。。
: Do both of these problems using at least one loop each and not using any
: special pre-existing functions that give you the answer with just one line
: of code.
: 1. Make a function to count the number of times a specified number is
: repeated in a list/array. That means that if we have a number list
: numberList=[5, 12, 0, 7, 2, 5, 10, 9, 12, 5];
: and we use the function call
: numRepeats(numberList, 5)
: we get the output: 3 --- meaning 5 occurs three times in numberList.

avatar
i*k
11
显然你挂了。。。因为英语没学好和人沟通存在问题。。。

【在 a****e 的大作中提到】
: 1, y = collections.Counter(x)
: 2,y = numpy.diag(x)
: 楼上的都没问题,取决于职位。如果应聘初级职位,一楼的方法足矣;中级level 的,
: 用二楼的;老人级别的,就得用叔的啦。

avatar
a*e
12
还是你懂叔。
人之所以是人,就是因为会使用前人用过的工具和总结出的知识。
这个出题的人连这都不懂,偏要自己写。幼齿啊。

【在 i****k 的大作中提到】
: 显然你挂了。。。因为英语没学好和人沟通存在问题。。。
avatar
j*3
13
人家不是特意说不能one line 么?楼上怎么都是一行的
相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。