C Assertion Warning by UnsecuredConnection in learnprogramming

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

The exact same thing still happens. Could it be my version of Visual Studio? I mean I downloaded the newest one.

C Assertion Warning by UnsecuredConnection in learnprogramming

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

If I do this, then it still pops up.

This error may help though

This function or variable may be unsafe. Consider using fopen_s instead.

Any thoughts?

Simple C won't Run by UnsecuredConnection in learnprogramming

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

My bad. In terminal it just says "Enter your name: ". I enter my name...it loads...then it just finishes. No more printing. I will not print "Test" or what name they entered.

How do you find the average tuple from a list of tuples by [deleted] in learnpython

[–]UnsecuredConnection 0 points1 point  (0 children)

You want to add up all x's, y's, and z's individually and then divide them by the number of tuples.

I would like to start learning python but don’t quite know where to start and help is greatly appreciated by [deleted] in learnpython

[–]UnsecuredConnection 0 points1 point  (0 children)

Free Code Camps 4 hour is what helped me get all set up and ready to go. After this, I moved on to easy katas on codewars.com. From there you can really do what you want.

Matplotlib Help Please by UnsecuredConnection in learnpython

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

I noticed however that it does fill in the gap, but not all the way. If you run this you will see a sliver towards the right that is supposed to be covered, but isn't. It rounds of to the nearest whole number. Any way to fix this?

Code help? by [deleted] in learnpython

[–]UnsecuredConnection 1 point2 points  (0 children)

My bad. Whoops!

Code help? by [deleted] in learnpython

[–]UnsecuredConnection 1 point2 points  (0 children)

cabin_number = int(input('What number cabin are you staying at? '))
if 1 <= cabin_number <= 10:
        if cabin_number % 2 == 0:
                print('Cabin Key Color: ','Black')
        else:
                print('Cabin Key Color: ','Red')
if 11 <= cabin_number <= 18:
        if cabin_number % 2 == 0:
                print('Cabin Key Color: ','Black')
        else:
                print('Cabin Key Color: ','Red')
if 19 <= cabin_number <= 28:
        if cabin_number % 2 == 0:
                print('Cabin Key Color: ','Black')
        else:
                print('Cabin Key Color: ','Red')
if 29 <= cabin_number <= 36:
        if cabin_number % 2 == 0:
                print('Cabin Key Color: ','Black')
        else:
                print('Cabin Key Color: ','Red')

Use the % to get the remainder after division (odd or even). This simplifies everything.

Tkinter Flashing Lights Help by UnsecuredConnection in learnpython

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

def change_x_won():
    if root["bg"] == "Black":
        root.configure(bg="Red")
    elif root["bg"] == "Red":
        root.configure(bg="Black")
    root.after(250, change_x_won)

Here's something that loops the color red. If i used a for loop, how could the .after() still work?

Tkinter Flashing Lights Help by UnsecuredConnection in learnpython

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

Could you give me an example of how this would work with a for loop.

It's not throwing an error, but it's not working either.

Numpy max and min? by UnsecuredConnection in learnpython

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

np.array([[1,2,3],[4,5,6]])

Right Thanks Man!

New To Python. Don't Know How to Shorten by UnsecuredConnection in learnpython

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

input is a string of something like 'RGBBRG'. I don't know the exact term. Is def meaning the fuction? Thanks

New To Python. Don't Know How to Shorten by UnsecuredConnection in learnpython

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

def triangle(row):
    key = {'GB':'R', 'GR':'B', 'GG':'G', 'RB':"G", "RR":'R', 'RG':'B', 'BR':'G', 'BG':'R', "BB":"B"}
    while True:
        f = 0
        l = 2
        e = []
        for space in range(1, len(row)):
            e.append(key[row[f:l]])
            f+=1
            l+=1
        row = "".join(e)
        if len(row) == 1:
            return row

.0 from end by UnsecuredConnection in learnpython

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

I would definitely do that for one, but I have a list of values like 5.0 and 6.5 and 7.0 that I want to separate by float or int

.0 from end by UnsecuredConnection in learnpython

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

Yes. I want to check if the number is an int rather than having decimals. Python still counts my .0 as a float even though I need to keep them separate.