Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from sys import argv
- script, a, j, x, y = argv
- a = int(argv[1])
- j = int(argv[2])
- x = int(argv[3])
- y = int(argv[4])
- print('\nSo, today, we\'re gonna try some more math stuff,\nwith the \'argv\' and \'raw_input\' commands, and then write to a file\nour complete results.\nmaybe...\n\n%s' % ('~'*80))
- print('\nSo, let\'s start off with those numbers you listed\nwhat were they again?\n\nach, yeah;\n\n%s, %s, %s and %s' % (a, j, x, y))
- print('I\'m going to write those to a file first so I don\'t forget them.')
- file = raw_input('What should we call it? ')
- txt = open(file, 'w')
- txt.truncate()
- txt.write('First number was: %s\nSecond number was: %s\nThird Number was: %s\nFourth number was: %s' % (a,j,x,y))
- txt.close()
- print('ok, cool. We got those...let\'s get a few more.')
- r1 = int(raw_input('Random number 1: '))
- r2 = int(raw_input('Random number 2: '))
- r3 = int(raw_input('Random number 3: '))
- print("""\nAight, so altogether we\'ve got:
- %s, %s, %s, %s, %s, %s, %s.
- Right?""" % (a,j,x,y,r1,r2,r3))
- print('~'*80)
- print('Let\'s do the math. We\'re solving for y.')
- print('%s' % int(((((a/r1)*j)+x)*r2)/r3))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement