Cora Dyce

Welcome to our website !
Please register an account to view the complete categories and forums.

Cora Dyce - Your personal dicing clan


    Python 3.0

    Share
    avatar
    Jaycubb
    Member
    Member

    Posts : 4859
    Join date : 2012-12-27
    Age : 20
    Location : Australia

    Python 3.0

    Post by Jaycubb on 2013-08-27, 06:41

    Challenge:
    Write a program that asks for a number, n, and then prints out all the numbers between 1 and n. Your program should work like this:


    Enter a number: 7
    1
    2
    3
    4
    5
    6
    7



    my code so far:

    n = int(input("Enter a number: "))
    while n > 1:
    print(n)
    n = n + 1

    But it just spams the number that I enter. I need it to count up to that number, how do I do it?
    avatar
    Jaycubb
    Member
    Member

    Posts : 4859
    Join date : 2012-12-27
    Age : 20
    Location : Australia

    Re: Python 3.0

    Post by Jaycubb on 2013-08-27, 06:54

    Dw I got it:

    n = int(input("Enter a number: "))
    c = 1

    while c <= n:
    print(c)
    c = c + 1
    avatar
    Allen's Slave
    Member
    Member

    Posts : 4445
    Join date : 2012-08-09
    Age : 23
    Location : A$AP

    Re: Python 3.0

    Post by Allen's Slave on 2013-08-27, 06:58

    Good work. Are you taking a programming class?
    avatar
    Jaycubb
    Member
    Member

    Posts : 4859
    Join date : 2012-12-27
    Age : 20
    Location : Australia

    Re: Python 3.0

    Post by Jaycubb on 2013-08-27, 10:32

    Yes. Im doing this competition online also. Its called Grok Learning. Im tied 2nd with 5000 people xD
    avatar
    Daft Punk
    VIP
    VIP

    Posts : 3818
    Join date : 2012-04-05
    Age : 25
    Location : California, USA

    Re: Python 3.0

    Post by Daft Punk on 2013-08-27, 10:54

    Tom wrote:Good work. Are you taking a programming class?
    I want to learn at my own pace (I don't want to go to school). Thoughts?
    avatar
    Allen's Slave
    Member
    Member

    Posts : 4445
    Join date : 2012-08-09
    Age : 23
    Location : A$AP

    Re: Python 3.0

    Post by Allen's Slave on 2013-08-27, 13:51

    Daft Punk wrote:
    Tom wrote:Good work. Are you taking a programming class?
    I want to learn at my own pace (I don't want to go to school).  Thoughts?
    Codeacademy.com

    Absolutely fantastic resource to get you into coding. Currently sponsored by Facebook, Microsoft, etc. I highly recommend.

    Also Jaycubb, not trying to be mean, but how does the competition work? If you're in 2nd place after finishing a while loop...
    avatar
    Tom's Slave
    VIP
    VIP

    Posts : 4757
    Join date : 2012-05-12
    Age : 21
    Location : Mac and Cheese

    Re: Python 3.0

    Post by Tom's Slave on 2013-08-27, 21:11

    Tom wrote:
    Daft Punk wrote:
    Tom wrote:Good work. Are you taking a programming class?
    I want to learn at my own pace (I don't want to go to school).  Thoughts?
    Codeacademy.com

    Absolutely fantastic resource to get you into coding. Currently sponsored by Facebook, Microsoft, etc. I highly recommend.

    Also Jaycubb, not trying to be mean, but how does the competition work? If you're in 2nd place after finishing a while loop...
    LOL. I was on codeacademy last night - great site rendeer 
    avatar
    Jon
    Sponsor
    Sponsor

    Posts : 13680
    Join date : 2011-09-19
    Age : 20
    Location : United Kingdom

    Dices Rolls
    Dice Roll:

    Re: Python 3.0

    Post by Jon on 2013-08-27, 22:19

    Hold on, I'll fetch Rob Crawl.
    avatar
    Understand
    Member
    Member

    Posts : 1314
    Join date : 2013-05-04
    Age : 17
    Location : A thief who stole a calendar got twelve months.

    Re: Python 3.0

    Post by Understand on 2013-08-28, 00:30

    Jon wrote:Hold on, I'll fetch Rob Crawl.
    NO I'LL FETCH HIM!spam
    avatar
    Jaycubb
    Member
    Member

    Posts : 4859
    Join date : 2012-12-27
    Age : 20
    Location : Australia

    Re: Python 3.0

    Post by Jaycubb on 2013-09-06, 12:11

    Tom wrote:
    Daft Punk wrote:
    Tom wrote:Good work. Are you taking a programming class?
    I want to learn at my own pace (I don't want to go to school).  Thoughts?
    Codeacademy.com

    Absolutely fantastic resource to get you into coding. Currently sponsored by Facebook, Microsoft, etc. I highly recommend.

    Also Jaycubb, not trying to be mean, but how does the competition work? If you're in 2nd place after finishing a while loop...
    Its grok learning, after you complete a challenge they mark your work on efficiency, theres a series of challenges u have to complete, all finished by the end of each week, 5 weeks. Its an international thing. btw Code academy is good to learn etc but theres heaps of flaws in there system, some times it says your work is wrong but its right. its fucked.
    avatar
    Sam
    Sponsor
    Sponsor

    Posts : 8329
    Join date : 2011-06-08
    Age : 23
    Location : Sean's house

    Re: Python 3.0

    Post by Sam on 2013-09-06, 18:12

    Jaycubb wrote:Dw I got it:

    n = int(input("Enter a number: "))
    c = 1

    while c <= n:
       print(c)
       c = c + 1
    Going to try to write that in Java (haven't done Java in 3 years).

    int n;
    int c=1; //Don't remember where the bracket-things go here

    n=; //I forget how to let user give input Sad

    if(n>=c){
    System.out.println("The number is"+c);
    }
    else{
    System.out.println("You're a dumb bitch. Pick a number 1-10.")
    }




    I fucked this one up. Need help, Tom.

    Cannons
    Member
    Member

    Posts : 3448
    Join date : 2012-06-28
    Age : 22

    Re: Python 3.0

    Post by Cannons on 2013-09-06, 18:22

    Sam wrote:
    Jaycubb wrote:Dw I got it:

    n = int(input("Enter a number: "))
    c = 1

    while c <= n:
       print(c)
       c = c + 1
    Going to try to write that in Java (haven't done Java in 3 years).

    int n;
    int c=1; //Don't remember where the bracket-things go here

    n=;     //I forget how to let user give input Sad

    if(n>=c){
    System.out.println("The number is"+c);
    }
    else{
    System.out.println("You're a dumb bitch. Pick a number 1-10.")
    }




    I fucked this one up. Need help, Tom.
    We will remember your last posts today :/
    avatar
    Allen's Slave
    Member
    Member

    Posts : 4445
    Join date : 2012-08-09
    Age : 23
    Location : A$AP

    Re: Python 3.0

    Post by Allen's Slave on 2013-09-06, 19:43

    Sam wrote:
    Jaycubb wrote:Dw I got it:

    n = int(input("Enter a number: "))
    c = 1

    while c <= n:
       print(c)
       c = c + 1
    Going to try to write that in Java (haven't done Java in 3 years).

    int n;
    int c=1; //Don't remember where the bracket-things go here

    n=;     //I forget how to let user give input Sad

    if(n>=c){
    System.out.println("The number is"+c);
    }
    else{
    System.out.println("You're a dumb bitch. Pick a number 1-10.")
    }




    I fucked this one up. Need help, Tom.
    This is so sloppy, I haven't worked with Java in ages.

    public static void main(String[] args){
    Scanner in = new Scanner(System.in);
    int x;
    do{
    System.out.print("Pick a number:");
    x = in.nextInt();}
    while(x > 10);

    for (int i = 1; i <= x; i++){
    System.out.println(i);}
    }

    You'll have to input java.util.Scanner.

    avatar
    Sam
    Sponsor
    Sponsor

    Posts : 8329
    Join date : 2011-06-08
    Age : 23
    Location : Sean's house

    Re: Python 3.0

    Post by Sam on 2013-09-06, 22:33

    Reading code gives me realization of great truth[wow]epiphany inception[/wow].

    Sponsored content

    Re: Python 3.0

    Post by Sponsored content


      Current date/time is 2017-09-25, 20:55