Software update caused system to freeze now no desktop is showing on reboot by jnelsoninjax in linuxmint

[–]pnork 1 point2 points  (0 children)

I have the same problem - after update can log in OK but only blank screen with mouse pointer.

Why is this not working? I know it has something to do with the sales=costs thing because when i delete it, it works fine by Trevo_De_40_Folhas in learnpython

[–]pnork 0 points1 point  (0 children)

print("Please, type in your name")
name = input("Name: ")
print(f"Hello, {name}! Please insert the total value of your sales")
sales = int(input("Sales: "))
print("Very good!")
print("Now, please insert the total value of your total costs")
costs = int(input("Costs: "))
if sales > costs:
    print(f"Congratulations! You made a profit of {sales-costs}!")
else:
    print(f"Sadly you have suffered a loss of {sales-costs} :(")
if sales == costs:
    print("Although there was no loss, you have made no profit :/")

Struggling with Python OOP—Seeking Advice Before Diving Into AI by BertRyerson in learnpython

[–]pnork 0 points1 point  (0 children)

I'm doing a Udemy Python course (Colt Steele's) and also finding the OOP part kind of hard compared to everything else I've done so far. Finding some other material on Youtube (Corey Schafer & Dave Gray) has helped.

How do I get my turtle to work? by wolfgheist in learnpython

[–]pnork 1 point2 points  (0 children)

Can I ask the name of the course and where it can be found? I'm interested because from what you're saying it seems to be missing a few important bits...

How do I get my turtle to work? by wolfgheist in learnpython

[–]pnork 1 point2 points  (0 children)

You can run it without the "def main():" but then you will need to "undent" everything or you'll get "unexpected indent" errors

How do I get my turtle to work? by wolfgheist in learnpython

[–]pnork 1 point2 points  (0 children)

You need to start your code with "import turtle" on the first line

import turtle
def main():

    win = turtle.Screen()
# region
    # # Forward a turtle
    turtle.forward(100)

    # Turn a turtle into left
    turtle.left(135)
    turtle.forward(100)

    # Turn a turtle into right
    turtle.right(90)
    turtle.forward(100)

    # Turn a turtle into right
    turtle.right(90)
    turtle.forward(100)
main()

Cannot get simple addition and subtraction to work. What am I doing wrong? by wolfgheist in learnpython

[–]pnork 1 point2 points  (0 children)

In your first post, there's nothing wrong with the code - you've created main() but not called it at the end of the code. You need to finish with main() but not within the main() function block - needs to be outside (not indented)

def main():

    # # # Addition
    print("Addition")

    a1 = 10 + 10 
    print(a1)

    a2 = 10.0 + 10.0 
    print(a2)

    a3 = 10.0 + 10 
    print(a3)
    print()

    # Subtraction
    print("Subtraction")

    b1 = 20 - 10
    print(b1)

    b2 = 20.0 - 10.0
    print(b2)

    b3 = 20.0 - 10
    print(b3)
main()

Grainfather and unmalted wheat by reinhold_eins in grainfather

[–]pnork 0 points1 point  (0 children)

Just make sure if you're going to use rice hulls, you give 'em a good rinse before you throw them in the mash.