• API
• FAQ
• Tools
• Archive
SHARE
TWEET

# Untitled

a guest Nov 12th, 2019 62 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
1. import math
2. import time
3.
4.
5. def run():
6.     global total
7.     total = 0
8.     file1 = open("Group1.txt", "w+")
9.     file2 = open("GroupList.txt","w+")
10.     file1.truncate(0)
11.     name = input("What is the name of your group? \n")
12.     file2.write(name)
13.     file1.write("The name of the group is:")
14.     file1.write(name)
15.     file1.write("\nThe size of the group is:")
16.
17.     def exception():
18.         try:
19.             global size_int
20.             size = input("What is the size of your group? \n")
21.             size_int = int(size)
22.             file1.write(size)
23.         except ValueError:
24.             print("Invalid response. Please try again. \n")
25.             exception()
26.         return (size)
27.
28.     exception()
29.     total = 3.00 * size_int
30.     if size_int > 10 or size_int < 4:
31.         size = input("Invalid Amount. Try again; 4 people Minimum people, 10 Maximum people.")
32.     else:
33.         i = size_int
34.         file1.write("\n\nThe pupils participating:")
35.         while i > 0:
36.             yn = 2
37.             pupilname = input("State a group member's name. \n")
38.             file1.write("\n")
39.             file1.write(pupilname)
40.             preorderq = input("Do you wish to pre-order a photo with the increase in price of 1.99? Y/N? \n")
41.             if preorderq == "Y" or preorderq == "y":
42.                 yn = 1
43.                 preorderq = "Yes"
44.                 total = total + 1.99
45.             if preorderq == "N" or preorderq == "n":
46.                 yn = 0
47.                 preorderq = "No"
48.                 total = total
49.             if yn == 2:
50.                 preorderq = input("Invalid Response. Please try again.\n")
51.             file1.write("\nDo preorder?: ")
52.             file1.write(preorderq)
53.             if yn == 0:
54.                 file1.write("  :  Pupil Total:\$3.00")
55.             if yn == 1:
56.                 file1.write("  :  Pupil Total:\$4.99")
57.             file1.write("\n")
58.             i = i - 1
59.             if i == 0:
60.                 file1.close()
61.
62.
63.
64.
65. run()
66. file1 = open("Group1.txt", "r")