These are chat archives for FreeCodeCamp/Help

3rd
Feb 2019
Dazhan9
@Dazhan9
Feb 03 05:14
how to create a paragraph?
kinopotato
@kinopotato
Feb 03 05:28
Is it normal that I stopped coding for a month and now I am afraid of loops? hehe
Manish Giri
@Manish-Giri
Feb 03 05:50
Yes
When I come back to binary search trees and BFS/DFS after a week or two off, i feel like wtf is all this
kinopotato
@kinopotato
Feb 03 06:59
ahhh coding, it's definitely something
Aditya
@ezioda004
Feb 03 07:00
It really do be like that sometimes
kinopotato
@kinopotato
Feb 03 07:03
programmers who know multiple languages probably feel like this all the time especially if they have to use a language every two weeks or so.
kinopotato
@kinopotato
Feb 03 07:28

Hello, how do I give the percentage based on the parent instead of the whole?

.emProfContainer{
  display: flex;
  width: 30%;
  margin-left: 70%;
  border: 1px solid red;
}

the margin-left: 70% is following the 70% of the whole screen instead of the 70% within the container

kinopotato
@kinopotato
Feb 03 07:51
Hello, how to do I get a div to flex down if it overflows from the parent div?
Nazar
@IsaakNazar
Feb 03 08:02
@kinopotato i guess one of the options is to give a width in a PX to parent div, and percentage of child width will depend on parent
kinopotato
@kinopotato
Feb 03 08:04
I figured it out (and that led to other problems as it always happens) it was following the width of the parent but my box is too big. there's something about css that makes it so forgettable and confusing that you have to study it every week basically
Niraj Nandish
@Nirajn2311
Feb 03 08:12
Does anyone the media queries for phones?
kinopotato
@kinopotato
Feb 03 10:37
Hello, is it possible to have a value for an input but have a placeholder text as well that shows up?
  <input type="number" min="0" max="16" value="0" placeholder="OT"></input>
zsmlxy
@zsmlxy
Feb 03 13:16
<h1>what do I do</h1>
kinopotato
@kinopotato
Feb 03 15:08

Good day, can someone tell me why my event listener isn't working?
html

<div class="totalContainer">
      <span id="weekTotalDisplay">Weekly Total:</span>
      <br>
      <button id="weekTotalBtn">Generate Total</button>
    </div>

js

document.querySelector("#weekTotalBtn").addEventListener("click", function(){
  alert("hi");
})

a simple console.log also doesn't work

kinopotato
@kinopotato
Feb 03 15:18
nevermind, something was conflicting with the function for some reason
kinopotato
@kinopotato
Feb 03 16:04
anyone around? need some help with js, probably basic but I can't figure out why it's not working
Sidak Singh Aulakh
@co16353sidak
Feb 03 17:07
Yes ?
Ramesh
@rnallu
Feb 03 18:30
@kinopotato its working fine.
SaintoftheGallows
@SaintoftheGallows
Feb 03 21:36
I have a question
num=int(input('Lets start with your first integer?'))
amo=[]



while True:

    Int=int(input('Enter Integer: '))
    if Int>=1:
        print('Next')
    else:
        print('All done')

        Int == 0


        amo.append(Int)
        avg=sum(amo)/Int
        print('Average of input',round(avg,2))
        break
how do I get the 0 to calculate the average, without itself being calculated?
ehutchllew
@ehutchllew
Feb 03 22:06
What is the purpose of your Int == 0 ?
@SaintoftheGallows
Also where is num being used? Why is avg being divided by the user's last input?
SaintoftheGallows
@SaintoftheGallows
Feb 03 22:15
Im trying to use the 0 to break
So when Int==0; Ideally this should be the 0 entered which finishes the input and gives the avg
and I took num out actually, I realized when I was rereading the post that it was useless.
Also, as im not understanding why the avg is being divided by the users last input, but I need the sum of all the input to have and average.
SaintoftheGallows
@SaintoftheGallows
Feb 03 23:04
amo=[]




while True:

    Int=int(input('Enter Integer: '))
    if Int>=1:
        amo.append(Int)
        avg=sum(amo)/Int
        print('Next')
    else:
        print('All done')
        Int==0


        print('Average of input',round(avg,2))
        break
This seems to work, Thanks for your input : )