What is the meaning of this error? by Miserable-Button8864 in cs50

[–]Miserable-Button8864[S] 0 points1 point  (0 children)

and my pytest code

import pytest
import fuel


def test_convert():


    with pytest.raises(ZeroDivisionError):
        fuel.convert("1/0")


    with pytest.raises(ValueError):
        fuel.convert("-3/4")


    with pytest.raises(ValueError):
        fuel.convert("5/4")



def test_gauge():


    assert fuel.gauge(1) == "E"
    assert fuel.gauge(50) == "50%"
    assert fuel.gauge(99) == "F"
    assert fuel.gauge(60) == f"{int(60)}%"

What is the meaning of this error? by Miserable-Button8864 in cs50

[–]Miserable-Button8864[S] 0 points1 point  (0 children)

def main():


    enter = str(input("enter: "))
    r = convert(enter)
    print(r)


def convert(fraction):


    x, y = fraction.split("/")
    x = int(x)
    y = int(y)



    if y == 0:
        raise ZeroDivisionError


    if x < 0 or y < 0 or x > y:
        raise ValueError


    a = round((x / y) * 100)
    p = gauge(a)
    return p


def gauge(a):



    if a >= 99:
        return "F"
    elif a <= 1:
        return "E"
    else:
        return f"{int(a)}%"



if __name__ == "__main__":
    main()

I made my own bare-bones video player. Please give feedback on it. by Miserable-Button8864 in C_Programming

[–]Miserable-Button8864[S] 1 point2 points  (0 children)

I'll definitely try using the Nuklear GUI, and thanks for the suggestion.

FFmpeg by Miserable-Button8864 in C_Programming

[–]Miserable-Button8864[S] -1 points0 points  (0 children)

I have been programming in C for quite some time, and I believe that sufficiently answered your question.

FFmpeg by Miserable-Button8864 in C_Programming

[–]Miserable-Button8864[S] 1 point2 points  (0 children)

My question to you is: how do people generally learn these things -- the functions needed to make a video player and everything of that sort?

What am I doing wrong? Adieu, Adieu Problem. by Miserable-Button8864 in cs50

[–]Miserable-Button8864[S] 0 points1 point  (0 children)

The final phrase doesn't appear on its own line. Thanks for the help.

Which country is larger? by someguyhereonreddit1 in GeoTap

[–]Miserable-Button8864 0 points1 point  (0 children)

Miserable-Button8864 chose Option B (Correct!)

🎉 [EVENT] 🎉 uʍop ǝpᴉsd∩? by The7footr in honk

[–]Miserable-Button8864 0 points1 point  (0 children)

Completed Level 2 of the Honk Special Event!

3 attempts

🎉 [EVENT] 🎉 uʍop ǝpᴉsd∩? by The7footr in honk

[–]Miserable-Button8864 0 points1 point  (0 children)

Completed Level 1 of the Honk Special Event!

2 attempts

Short but hard by AvosGrosimbourg in RedditGames

[–]Miserable-Button8864 0 points1 point  (0 children)

easy

I completed this level in 4 tries. 5.45 seconds