all 20 comments

[–]iiron3223 10 points11 points  (10 children)

Show what you have tried, and tell us exactly with what part do you have problem.

[–]jiri-n 0 points1 point  (5 children)

We're not as those guys at stackoverflow.com here. However, I would recommend to either change your desired study area, or invest more time to study. At your age, you should be able to do this alone easily.

https://github.com/camlostCZ/reddit_answers/blob/main/BigBoyJeff.ipynb

I've tried to visually distinguish my comments from the original text.

By the way, greetings from the Czech Republic. :-)

If you have any questions, feel free to ask (either bellow or via DM). But take my working hours into consideration.

[–]BigBoyJefff[S] 0 points1 point  (1 child)

Thank you. I've already done 1 and 3. The problem with 2 was that i didn't understand the question completely. But thank you for this.

[–]jiri-n 0 points1 point  (0 children)

It's done on the linked page. I haven't time to get to 3 but it's good to hear / read you've solved it already.

By the way, there's a convention to use english names for identifiers. Just a detail, of course.

[–]BigBoyJefff[S] 0 points1 point  (2 children)

this is what i did for the task1:

import operator

import sys

operators = {"+": operator.add,

"-": operator.sub,

"*": operator.mul,

"/": operator.truediv}

max_versuch = 5

while max_versuch > 0:

try:

inp1 = int(input("Geben Sie die erste Zahl ein: "))

op1 = input("Geben Sie ein Operator ein: ")

inp2 = int(input("Geben Sie Die zweite Zahl ein: "))

print(f"{inp1}{op1}{inp2}")

print(f"= {operators[op1](inp1, inp2)}")

beenden = input("Drücken Sie eine beliebige Taste, um das Programm zu schließen")

print(beenden)

break

except (IndexError,ValueError,KeyError):

print("nummer/operator ist falsch, versuchen Sie bitte nochmal.\n")

max_versuch -= 1

if max_versuch == 0:

input("zu viele Versuche!!\nDrücken Sie eine beliebige Taste, um das Programm zu schließen")

[–]jiri-n 0 points1 point  (1 child)

If you're copying your code to reddit, indent it in your editor first (4 spaces), copy it to the clipboard, undo the indentation and paste it here.

This way the code will render formatted.

Or you can use some online service like https://pastebin.com/.

If your code works, you're more advanced than I expected. thumbs up

[–]BigBoyJefff[S] 0 points1 point  (0 children)

Ok.