All Activity

This stream auto-updates     

  1. Today
  2. Yesterday
  3. Last week
  4. Cignare

    New to the forum!

    Hello everyone, just wanted to say hi and introduce myself. My name is Cignare.
  5. Cignare


    Hello everyone, If anyone here has a lot of time in their hands and you have skills in C++,SQL,Linux, VM,Client build let me know. I am kinda stuck on a project and I really need the help. Cignare
  6. Earlier
  7. shrekismylord

    Problem with hello world

    Try renaming the file Hopefully, that works!
  8. Hello there, I think your Python Training has been completed and you have a great knowledge of Python Language. So, can you tell me which programming Language is an implementation of Python programming language designed to run on Java Platform?
  9. Thanks you! I have always been interested in learning Python and this short series of videos should hopefully help me on my feet!!
  10. Ole

    Strategy Map

    Hi there from Germany, I'm in the consulting business for strategy development. Normally I'm using online tools to help my customers and friends online in a collaboration form... there are many tools to develop strategies p.e. based on Michel Porters five forces or Kaplans balanced scorecard. Also I like Osterwalders strategy Canvas..... But I cannot find easy to handle online tools to devlop a strategy map like a canvas creating it online like a interactive drawing tool. After finishing it should be possible to import data from this map into data base; means to start data collecting with this strategy map structure further on the strategy map should be annotated, means the designed process flows should be marked, linked an so on that you ave more information in this strategy map and you can drill down from this to further management tools and KPIs to see where you are in your business.... Python should be the right tool to realise this step by step Ole
  11. Matthew

    My Code Is Not Working

    Oh my goodness, thanks so much for helping me with all of this - i feel super embarrassed that I didn't see this myself haha but thanks so much!
  12. BigNibba

    My Code Is Not Working

    The variable var1 is missing an extra bracket '(' . int(input("Enter num1: ") **)** (ignore ** there to show what u need to add). And do the same for 'var2'
  13. Matthew

    My Code Is Not Working

    Hey guys, I have been watching kjdelectronics on his python tutorial videos and have recently gotten to the part where you build a calculator, but I'm having trouble in the finalization process of it all. My code seems to be flawed - I keep getting a syntax error and have no idea why because I have copied the code exactly as he presents it in the video. I was wondering if anyone could look at it and tell me where my issue (bug) is located. Here is my code and a screenshot of the syntax error. #Returns the sum of num1 and num2 def add(num1, num2): return num1 + num2 #Returs the result of subtracting num1 - num2 def sub(num1, num2): return num1 - num2 #Returns the result of multiplying num1 * num2 def mul(num1, num2): return num1 * num2 #Returns the result of dividing num1 / num2 def div(num, num2): return num1 / num2 def main(): operation = input("What do you want to do? (+, -, *, /): ") if(operation != '+' and operation != '-' and operation != '*' and operation != '/'): #invalid operation print("You must enter a valid operation") else: var1 = int(input("Enter num1: ") var2 = int(input("Enter num2: ") if(operation == '+'): print(add(var1, var2)) elif(operation == '/'): print(div(var1, var2)) elif(operation == '-'): print(sub(var1, var2)) else: print(mul(var1, var2)) main()
  14. Hello, thank you for your effort in this tutorial and i know it is pretty old and you won't propably answert but maybe someone know what to do. I wrote my code but i have little problem i guess its beacuse of the fact that i created 2 functions - shape and shape_random instead of dealing with it in one function. But i want to know why does error occur, what's the reason. So everything works if we choose 1, 2 or 3 but then when loop comes to begining and starts over i get error after choosing 1 or 2 (does't matter if previous choice was 1 or 2) . Sorry if my English hurt your eyes. Here is code: import random import turtle def random_color(): num=random.randint(0,5) if(num == 0): return 'yellow' elif(num==1): return 'red' elif(num==2): return 'blue' elif(num==3): return 'green' elif(num==4): return 'brown' elif(num==5): return 'purple' def shape(shape, coord1, coord2): if(shape==0): #Square turtle.penup() turtle.goto(coord1, coord2) turtle.color(random_color()) turtle.pendown(), steps=4) elif(shape==1): #Triangle turtle.penup() turtle.goto(coord1, coord2) turtle.color(random_color()) turtle.pendown(), steps=3) elif(shape==2): #Circle turtle.penup() turtle.goto(coord1, coord2) turtle.color(random_color()) turtle.pendown() else: print("Wrong number.") def random_shape(coord1, coord2): random_shape = random.randint(0,2) if (random_shape == 0): # Square turtle.penup() turtle.goto(coord1, coord2) turtle.color(random_color()) turtle.pendown(), steps=4) turtle.penup() turtle.forward(100) elif (random_shape == 1): # Triangle turtle.penup() turtle.goto(coord1, coord2) turtle.color(random_color()) turtle.pendown(), steps=3) turtle.penup() turtle.forward(100) elif (random_shape == 2): # Circle turtle.penup() turtle.goto(coord1, coord2) turtle.color(random_color()) turtle.pendown() turtle.penup() turtle.forward(100) def main(): while True: x = - 300 y = 100 print("Welcome.") print("-=-=-=-=-=-=-=-=-=-=-=-=-=-") print("\nMain Menu:") print("\n1.Draw a specific figure") print("\n2.Draw random figure") print("\n3.Exit") print("\n-=-=-=-=-=-=-=-=-=-=-=-=-=-") choice=int(input("What's your decision?")) if(choice==1): print("Figures Menu:") print("0.Square") print("1.Triangle") print("2.Circle") specific=int(input("What's your decision?")) number=int(input("How many times do u want to draw that figure? 1-10")) if number <0 or number >11: print("U aren't allowed to print this amount of figures.") continue for i in range(0,number): if (i==3 or i==6 or i==9): x = -300 y -= 50 shape(specific, x, y) x += 100 turtle.done() elif(choice == 2): number = int(input("How many times do u want to draw? 1-10")) if number<0 or number>11: print("U aren't allowed to print this amount of figures.") continue for i in range(0,number): if (i==3 or i==6 or i==9): x = -300 y -= 50 random_shape(x, y) x+=100 turtle.done() elif(choice ==3): print("The program will close.") break main() Traceback (most recent call last): File "C:/Users/USERNAME/PycharmProjects/Project1/", line 122, in <module> main() File "C:/Users/USERNAME/PycharmProjects/Project1/", line 101, in main shape(specific, x, y) File "C:/Users/USERNAME/PycharmProjects/Project1/", line 34, in shape turtle.penup() File "<string>", line 5, in penup turtle.Terminator Process finished with exit code 1
  15. Kevin

    Introducing Arduino

    I recommend starting with blink. Play with that and get the LED on the board to blink at different rates. Then move the LED onto a bread board with a resistor. Once you do that you should have your feet wet.
  16. Light

    School Project using C++

    i just want to ask what school project is good for c++ program?
  17. Ronj1952

    Not compiled code doesn't run

    I found your problem you use the symbols < > what you should be using is ( ) I realize that you probably already have the answer.
  18. Ronj1952

    Problem with hello world

    I am getting back into programing after an extended break and the Python programing language was recommended. I'm starting with the absolute beginners tutorial and have run into the following problem with the command line. C:\users\owner\desktop>Python 'Python' is not recognized as an internal or external command, operable program or batch file. I am running windows 7, Python 3.7, and I have triple checked the Environmental Variables with Variable Name: Python and Variable Value: C:\Python. Is there anything that is obvious to generate the error?
  19. Pnr4code

    Python Programming Examples

    Python Programming Examples
  20. Haseeb

    issue with function (creating functions)

    indentation should all be under the def testing_function():
  21. Haseeb

    Rock Paper Scissors Game Problem

    you are not calling the main( ) function
  22. arifin benny pristyadika

    Python Beginner Tutorial 6 - Exceptions and Loops

    def add(num1, num2): """Returns num1 plus num2.""" return num1 + num2 def sub(num1, num2): """Returns num1 minus num2.""" return num1 - num2 def mul(num1, num2): """Returns num1 times num2.""" return num1 * num2 def div(num1, num2): """Returns num1 divided by num2.""" return num1 / num2 def main(): """Allows user to run basic calculator operations with two numbers.""" validInput = False while not validInput: # Get user input try: num1 = int(input("What is number 1?")) num2 = int(input("What is number 2?")) operation = int(input("What do you want to do? 1. add, 2. subtract, 3. multiply, or 4. divide. Enter number: ")) validInput = True except: print("Invalid input. Try again.") # Determine operation if (operation == 1): print("Adding...") print(add(num1, num2)) con() elif (operation == 2): print("Subtracting...") print(sub(num1, num2)) con() elif (operation == 3): print("Multiplying...") print(mul(num1, num2)) con() elif (operation == 4): print("Dividing...") print(div(num1, num2)) con() else: print("I don't understand") def con(): valid = False while not valid: try: cont = int(input(" do you want to continue? press 1 to continue, press other than 1 to exit ")) if cont == 1: main() valid = True else: return except: return hi kevin ty for the tutorials, is my code correct? tell me if there is a mistake please !!! ty
  23. Haseeb

    Rock Paper Scissors Beginners practice

    Never done programming before. I became interested in Python and started watching kjdElectronics tutorials. I would appreciate any comments or suggestions !!! import random import time # computer random input is assigned the object def computer(comp_input): time.sleep(1) if(comp_input == 1): print('computer selected - rock') elif(comp_input == 2): print('computer selected - paper') elif(comp_input == 3): print('computer selected - scissors') # processing the result of computer and user input def operation(comp_input,user_input): if ((comp_input == 1 and user_input == 'rock') or (comp_input == 2 and user_input == 'paper') or (comp_input == 3 and user_input == 'scissors')): computer(comp_input) time.sleep(1) print('its a TIE !!') elif ((comp_input == 2 and user_input == 'rock') or (comp_input == 3 and user_input == 'paper') or (comp_input == 1 and user_input == 'scissors')): computer(comp_input) time.sleep(1) print('LOSER !!') elif ((comp_input == 3 and user_input == 'rock') or (comp_input == 1 and user_input == 'paper') or (comp_input == 2 and user_input == 'scissors')): computer(comp_input) time.sleep(1) print('WINNER !!') else: print('invalid input. try again') time.sleep(1) main() # select rock, paper or scissors def main(): restart = True while restart: comp_input = random.randint(1, 3) user_input = input('select one.. rock, paper or scissors: ') operation(comp_input,user_input) time.sleep(1) again = input('do you want to play another game? (y/n): ') if(again == 'y'): restart = True else: time.sleep(1) print('i will miss you. bye !') time.sleep(1) restart = False main()
  24. Quinn El-Nathanlee

    Introducing Arduino

    Bring it up, I have bought the starter kit (arduino starter kit ) but I don't know were to start.
  25. hello i have problem with python from series no 7" boolean loop" we lean how creat your culculate but that script i was wrote look exactl how you told when i try to run script in cmd i does't display correct answer what is numer1?22 what is number2?43 what do you want to do? Add substract multiply divide)add i dont understand
  26. Quinn El-Nathanlee


    Where do u have challenges. ..?
  27. learning_all_the_time2252

    issue with function (creating functions)

    Hello and thanks for your help. i have a function but when i execute it, it works. The issue is that it isn't supposed to work as i haven't called the function. I have it defined but haven't' called it. Yet it works. in CMD from my desktop i type the function it should fail as it hasn't been called. The failure isn't happening. When i go back into notepad++ and call the function then save. i receive the same results. it works. My issue is I don't know if I am defining and calling this function correctly. Hope that makes sense. I will post my code below and also the link from the Youtube video in which i am being instructed. it is one of yours. I am also using Python 3, not sure if that matters. My indentations are only one space over and not a tab. def testing_function(): print ("hello there") myName = input ("What is your name? ") myVariable = 'Hello' #myVar = int(input ("Enter a number: ")) #print (myName) print (myVariable , myName) if (myName == "Chamyria" ): print("Chamyria is loved by Antonio") elif(myName == "Paisleyann"): print ("You are our beloved daughter") else: print ("Antonio doesn't want you only Chamyria!") print ("Antonio doesn't want you only Chamyria!")
  1. Load more activity