![]() |
|
[Python] Python task - Printable Version +- Hack Forums (https://hackforums.net) +-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444) +--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151) +---- Forum: Software Development (https://hackforums.net/forumdisplay.php?fid=118) +---- Thread: [Python] Python task (/showthread.php?tid=5947348) |
Python task - blackcoder00 - Mar 4, 2019 Hi guys first i'm new in python and second i started to create the algorithm of this task so i'm asking how to transform my algorithm into a script python for this task ?i want to test the code to get an idea of python language like i did in pascal i need help guys Pascal code : PHP Code PHP Code PHP Code PHP Code ![]() ![]() ![]()
RE: Python task - daymon - Mar 4, 2019 Are you asking how to build the script itself or..? RE: Python task - blackcoder00 - Mar 4, 2019 (Mar 4, 2019 05:31 PM)Sin+ Wrote: Are you asking how to build the script itself or..? i solved the task with pascal so i want to find all the script with python to compare them with my scripts in pascal to uunderstand the different between (Mar 4, 2019 05:31 PM)Sin+ Wrote: Are you asking how to build the script itself or..? so yeah i want to see this task coded with python for comparing with pascal code and ty Just take a look bro what is wrong with my code ![]() ![]()
RE: Python task - nicodxmus - Mar 4, 2019 In test2 u have just a simple mistake, you don't have any return. Code no_list = [22, 68, 90, 78, 90, 88]Code return summing/countEDIT: The third exercise again no return just add Code return maxFull code: Code no_list = [1,2,3,4,8,3]RE: Python task - blackcoder00 - Mar 4, 2019 (Mar 4, 2019 08:03 PM)nicodxmus Wrote: In test2 u have just a simple mistake, you don't have any return. ty bro what about the other 3,4 script task btw i send u 20Bytes for helping RE: Python task - nicodxmus - Mar 4, 2019 And in the fourth exercise, I can't understand what's your idea in this algorithm but I can show you how to make it easier: Code no_list = [1,2,10,3,4,8,3,9,2,3,2,1,4]You have good ideas but when you are doing stuff like this where you are printing values from functions you always have to return something. RE: Python task - blackcoder00 - Mar 4, 2019 (Mar 4, 2019 08:30 PM)nicodxmus Wrote: And in the fourth exercise, I can't understand what's your idea in this algorithm but I can show you how to make it easier: ty bro for eveything i have done it by myself it's my first day with python XD PHP Code RE: Python task - datguy.dev - Mar 6, 2019 (Mar 4, 2019 09:03 PM)blackcoder00 Wrote: ty bro for eveything i have done it by myself it's my first day with python XD You're using the variable s globally, when it should probably be inside the scope of function unique_list() above the for loop. Otherwise, it should be s = unique_list(no_list) then print(s). |