Jump to content

New Here

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
11 replies to this topic

#1
Tyson.S

Tyson.S

    Newbie

  • Members
  • Pip
  • 4 posts
Hey,

My name is Tyson, I have been programming with python just a little over 1 month now. I found the forums and just thought it was a great place to get help and help anyone who needs it with python.

This is an example of some of the stuff i do now:

print('Random Sum Generator')

sort = raw_input('What sorts of sums would you like to generate: ')

mode = raw_input('What mode would you like to generate sums with: ')


while sort == '+' and mode == 'easy':

    print('')

    print('Here is your sum: ')

    no1 = random.randrange(1, 30)

    no2 = random.randrange(1, 30)

    print(`no1` +' + '+ `no2`)

    answer = input('Answer: ')

    if answer == no1 + no2:

        print('Well done!')

    elif answer != no1 + no2:

        print('Sorry that was wrong.')


while sort == '-' and mode == 'easy':

    print('')

    print('Here is your sum: ')

    no1 = random.randrange(1, 30)

    no2 = random.randrange(1, 30)

    print(`no1` +' - '+ `no2`)

    answer = input('Answer: ')

    if answer == no1 - no2:

        print('Well done!')

    elif answer != no1 - no2:

        print('Sorry that was wrong.')


while sort == '+' and mode == 'medium':

    print('')

    print('Here is your sum: ')

    no1 = random.randrange(1, 40)

    no2 = random.randrange(1, 40)

    print(`no1` +' + '+ `no2`)

    answer = input('Answer: ')

    if answer == no1 + no2:

        print('Well done!')

    elif answer != no1 + no2:

        print('Sorry that was wrong.')


while sort == '-' and mode == 'medium':

    print('')

    print('Here is your sum: ')

    no1 = random.randrange(1, 40)

    no2 = random.randrange(1, 40)

    print(`no1` +' - '+ `no2`)

    answer = input('Answer: ')

    if answer == no1 - no2:

        print('Well done!')

    elif answer != no1 - no2:

        print('Sorry that was wrong.')


while sort == '+' and mode == 'hard':

    print('')

    print('Here is your sum: ')

    no1 = random.randrange(1, 50)

    no2 = random.randrange(1, 50)

    print(`no1` +' + '+ `no2`)

    answer = input('Answer: ')

    if answer == no1 + no2:

        print('Well done!')

    elif answer != no1 + no2:

        print('Sorry that was wrong.')


while sort == '-' and mode == 'hard':

    print('')

    print('Here is your sum: ')

    no1 = random.randrange(1, 50)

    no2 = random.randrange(1, 50)

    print(`no1` +' - '+ `no2`)

    answer = input('Answer: ')

    if answer == no1 - no2:

        print('Well done!')

    elif answer != no1 - no2:

        print('Sorry that was wrong.')


I know its quite long but what it is, is a random sum generator. It will prompt you with two questions; What sort of sum and What sort of mode. It will now give you unlimited about of random sums.

Thanks,
Tyson.S

#2
CallBackGuy

CallBackGuy

    Newbie

  • Members
  • PipPip
  • 29 posts
Not to be rude, but did you have a question?

#3
Orjan

Orjan

    Writes binary right handed and hex left handed

  • Moderators
  • 3,299 posts
Moved to a more proper category.
__________________________________________
I study Information Systems at Karlstad University when I'm not on CodeCall

#4
WingedPanther

WingedPanther

    A spammer's worst nightmare

  • Moderators
  • 16,831 posts
Welcome aboard!
Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog

#5
Tyson.S

Tyson.S

    Newbie

  • Members
  • Pip
  • 4 posts
Thankyou Wing

#6
Vswe

Vswe

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 9,552 posts
Welcome to CC.

#7
ZekeDragon

ZekeDragon

    Writes binary right handed and hex left handed

  • Moderators
  • 2,103 posts
Welcome. Python's a fun language, but you've only scratched the surface!

There's much more to learn. :)

- Zeke

#8
Guest_Jordan_*

Guest_Jordan_*
  • Guests
Hey Tyson, welcome to CodeCall!

#9
Andrew.G

Andrew.G

    Programming Expert

  • Members
  • PipPipPipPipPipPip
  • 395 posts
Posted via CodeCall Mobile Welcome to CC Tyson! :)

#10
John

John

    Writes binary right handed and hex left handed

  • Moderators
  • 6,321 posts
Hello Tyson, Welcome to CodeCall!

#11
Tyson.S

Tyson.S

    Newbie

  • Members
  • Pip
  • 4 posts
:D all the love, what a great place this is :)

#12
xXHalfSliceXx

xXHalfSliceXx

    Speaks fluent binary

  • Moderators
  • 1,694 posts
Welcome to CC Tyson

Posted Image
Posted Image