• Register

Recent questions tagged program

0 votes
1 answer 4 views
Problem: Before executing code, Python interpreter reads source file and define few special variables/global variables. How to python interpreter is running that module (the source file) as the main program, it sets the special __name__ variable to have a value &ldquo ... module, __name__ will be set to the module’s name. Module’s name is available as value to __name__ global variable?
asked Jan 11 Mashhoodch 5.6k points
0 votes
1 answer 10 views
Problem: I want to implement a kind of console (function menu_principal), where the user can go to different menus according to their choice. One of these options is to enter a directory (function dir_manager, accessed with the number 1). Once the user wants to end the execution, he must type the ... * option1 = 1; // <---- THIS IS THE ERROR return; } else if (* option1 == 9) { return; } } }
asked Jan 1 sasha 5.3k points
0 votes
1 answer 9 views
Problem: I want to write a function that receives two pointers to functions and returns a pointer to the function composicion. Is it possible to do that? This was my idea: typedef int (* integerFunction) (int); integer function composition (integer function f1, integer function f2) { return f1 (f2); }
asked Jan 1 sasha 5.3k points
0 votes
1 answer 25 views
Problem: Hi there! I am new to the world of programming. My programming teacher gave me an assignment in which I have to write a program in which there would be a function that will take two strings as input from user and will compare the size of both strings ... the larger string of the two. I have no clue how to do that. Please provide me with the sample program with proper description. Thanks
asked Nov 25, 2020 Code Learner 5.5k points
0 votes
1 answer 44 views
Problem: Hello guys, While solving basic condition problems in python I am trying to implement the below logic but don't know python is throwing error, the invalid syntax for no reason, below is the code. I have tried various things to fix this but still can able to solve ... "main.py", line 5 for y in fruits: ^ IndentationError: expected an indented block This is the error I am getting in this.
asked Jun 28, 2020 Gavin 15.3k points
1 vote
1 answer 13 views
Problem: Hello kodlogs, I have been working with the python program and wanted to calculate the max value from list is there any function available to do this or I have to go with the comparison basis than it would take a long time to do a simple searching to the maximum element is there any short cut available in the python to achieve this?
asked Jun 28, 2020 Gavin 15.3k points
0 votes
2 answers 379 views
Problem: Hello guys, I am running this code in visual code but dont know why the error ic coming can you please check the error of if__name__ ==__main__invalid syntax. def main(): generateRandomNumbers() def generateRandomNumbers(): print ('Test') si_ze = 0 nameLength=0 ... == "__main__" main() Getting Syntax error if name == main ^ SyntaxError: invalid syntax Process finished with exit code 1
asked Jun 9, 2020 Gavin 15.3k points
1 vote
1 answer 36 views
Problem: Hello guys, While solving basic condition problem in python I am trying to implement the below logic but don't know python is throwing error, the invalid syntax for no reason,below is the code. day = int(input("Enter the day of week:")) vacation = (input("Enter is vacation? [True| ... 00") else: if day == 0 or day == 6: print("Alarm is off") elif: print("10:00") Dont know what is wrong.
asked Jun 7, 2020 Gavin 15.3k points
1 vote
1 answer 44 views
Problem: In Python while practising the few question from c language i tried to implement the few of the program but most of the time it come up with the syntax error or the intend error can you help what actually i am missing the syntax error in python every time i execute it.
asked Jun 3, 2020 Gavin 15.3k points
0 votes
2 answers 92 views
I'm new in java programming, I know how to find out the largest or smallest number from an array. But I'm facing problem when I'm trying to find out smallest staring in 3 string. Please help me write a method min that has three string parameters and returns the smallest.
asked May 2, 2020 samhaz 5k points
1 vote
1 answer 132 views
Problem: Can anyone provide me an expression that executes the loop body as long as the user enters a non-negative number. Thanks in advance.
asked Apr 9, 2020 LizzyM 6.1k points
0 votes
1 answer 85 views
Problem: What best defines a programming language?
asked Mar 9, 2020 ArifulIslam 5.6k points
0 votes
1 answer 292 views
Problem: Can anyone help it was actually asked in exam as following and I need to know whether my answer was right or not? What makes system changes to repair design flaws, coding errors, or implementation issues? A. Corrective maintenance B. Preventative maintenance C. Pilot implementation D. Phased implementation
asked Feb 24, 2020 maddi86 5.4k points
0 votes
1 answer 67 views
Problem: Can anyone help it was actually asked in exam as following and I need to know whether my answer was right or not? Write an expression that whose value is the fifth character of the String name?
asked Feb 24, 2020 maddi86 5.4k points
0 votes
1 answer 65 views
Problem: I am new in programming and my logic is not good, can anyone give the right solution? How to declare a character variable named c?
asked Feb 22, 2020 maddi86 5.4k points
0 votes
1 answer 474 views
Problem: I am new and my logic is not so strong can any one give me right solution? What does the following statement mean? num1, num2 = get_num() a. The function get_num() is expected to return a value each for num1 and num2. b. The function get_num() is expected to return a value and assign it to num1 and num2. c. Statement will cause a syntax error. d. Statement will cause a run-time error.
asked Feb 22, 2020 maddi86 5.4k points
0 votes
1 answer 169 views
Problem: I am new in programming and my logic is not good, can anyone give the right solution? Which of the following could not be a linear programming problem constraint? A.1A + 2B &le; 3 B.1A + 2B &ge; 3 C.1A + 2B = 3 D.1A + 2B + 3C + 4D &le; 5 E.1A + 2B
asked Feb 22, 2020 maddi86 5.4k points
0 votes
1 answer 263 views
Problem: I am new and learning, I need help, can anyone help by filling in the blanks? The ability for a protocol or program to determine that something went wrong is known as ________?
asked Feb 21, 2020 maddi86 5.4k points
0 votes
2 answers 122 views
Problem: I am new, I need help, can anyone help? This is a special value that marks the end of a list of values?
asked Feb 21, 2020 maddi86 5.4k points
0 votes
1 answer 95 views
Problem: I am trying to run a query, can any one guide me what does this query means? What does the following statement do? double[] array1 = new double[10]; a. Declares array1 to be a reference to an array of double values b. Creates an instance of an array of 10 double values c. Will allow valid subscripts in the range of 0 - 9 d. All of these
asked Feb 21, 2020 maddi86 5.4k points