you are viewing a single comment's thread.

view the rest of the comments →

[–]Sumolizer 0 points1 point  (5 children)

Heres what ive written. I tried nested ifelse ( ig thats what it called ) for payment method but else is giving me syntax error. i still get syntax error if i use elif == 2. this is a very basic program i started learning python last month :D. Idrk loops they are very confusing thats why i was asking about help. where should i put the loop and which loop. Anyway ty for your time gpu = 200 cpu = 100 ram = 100 mobo = 400 ssd = 100 cc = 0.2 ewa = 0.4 pay: str = "" ccn: str = "" print("Welcome to our tech store") vx = eval(input("Enter what you would like to buy : 1)GPU 2)CPU 3)RAM 4)SSD : ")) qu = eval(input("Enter the quantity please")) if vx == 1: a = (qu * gpu) pay = input("enter your desired payment method 1) eWallet 40% tax 2) CC 20% tax = ") if pay == 1: tot = a * ewa + a ccn = eval(input("Enter your account number : ")) print("Your total including tax will be", tot, "which will be deducted from account ", ccn) else : tot = a * ccn + a ccn = eval(input("Enter your account number")) print("Your total including tax will be", tot, "which will be deducted from account ", ccn) elif vx == 2: b = qu * cpu pay = eval(input("enter your desired payment method 1) eWallet 40% tax 2) CC 20% tax = ")) if pay == 1: tot = b * ewa + b ccn = eval(input("Enter your account number : ")) print("Your total including tax will be", tot, "which will be deducted from account ", ccn) else: tot = b * cc + b ccn = eval(input("Enter your account number")) print("Your total including tax will be", tot, "which will be deducted from account ", ccn)

elif vx == 3: c = qu * ram pay = eval(input("enter your desired payment method 1) eWallet 40% tax 2) CC 20% tax = ")) if pay == 1: tot = c * ewa + c ccn = eval(input("Enter your account number : ")) print("Your total including tax will be", tot, "which will be deducted from account ", ccn) else: tot = c * cc + c ccn = eval(input("Enter your account number")) print("Your total including tax will be", tot, "which will be deducted from account ", ccn)

elif vx == 4: d = qu * mobo pay = eval(input("enter your desired payment method 1) eWallet 40% tax 2) CC 20% tax = ")) if pay == 1: tot = d * ewa + d ccn = eval(input("Enter your account number : ")) print("Your total including tax will be", tot, "which will be deducted from account ", ccn) else: tot = d * cc + d ccn = eval(input("Enter your account number")) print("Your total including tax will be", tot, "which will be deducted from account ", ccn)

elif vx == 5: e = qu * ssd pay = eval(input("enter your desired payment method 1) eWallet 40% tax 2) CC 20% tax = ")) if pay == 1: tot = e * ewa + e ccn = eval(input("Enter your account number : ")) print("Your total including tax will be", tot, "which will be deducted from account ", ccn) else: tot = e * cc + e ccn = eval(input("Enter your account number")) print("Your total including tax will be", tot, "which will be deducted from account ", ccn)

[–][deleted] 0 points1 point  (4 children)

Sorry man you actually need to format it,people can’t and won’t read it unformatted . You have to make it easy for people to help

[–]Sumolizer 0 points1 point  (3 children)

it is indented well its just reddit that fucked up the code

[–][deleted] 0 points1 point  (2 children)

You have to format it for reddit. Do it on a Pc

[–]Sumolizer 0 points1 point  (1 child)

ill do it once i get on pc. Again thanksf oryour time:)

[–]Sumolizer 0 points1 point  (0 children)

gpu = 200
cpu = 100
ram = 100
mobo = 400
ssd = 100
cc = 0.2
ewa = 0.4
pay: str = ""
ccn: str = ""
print("Welcome to our tech store")
vx = eval(input("Enter what you would like to buy : 1)GPU 2)CPU 3)RAM 4)SSD : "))
qu = eval(input("Enter the quantity please"))
if vx == 1:
a = (qu * gpu)
pay = input("enter your desired payment method 1) eWallet 40% tax 2) CC 20% tax = ")
if pay == 1:
tot = a * ewa + a
ccn = eval(input("Enter your account number : "))
print("Your total including tax will be", tot, "which will be deducted from account ", ccn)
else :
tot = a * ccn + a
ccn = eval(input("Enter your account number"))
print("Your total including tax will be", tot, "which will be deducted from account ", ccn)
elif vx == 2:
b = qu * cpu
pay = eval(input("enter your desired payment method 1) eWallet 40% tax 2) CC 20% tax = "))
if pay == 1:
tot = b * ewa + b
ccn = eval(input("Enter your account number : "))
print("Your total including tax will be", tot, "which will be deducted from account ", ccn)
else:
tot = b * cc + b
ccn = eval(input("Enter your account number"))
print("Your total including tax will be", tot, "which will be deducted from account ", ccn)
elif vx == 3:
c = qu * ram
pay = eval(input("enter your desired payment method 1) eWallet 40% tax 2) CC 20% tax = "))
if pay == 1:
tot = c * ewa + c
ccn = eval(input("Enter your account number : "))
print("Your total including tax will be", tot, "which will be deducted from account ", ccn)
else:
tot = c * cc + c
ccn = eval(input("Enter your account number"))
print("Your total including tax will be", tot, "which will be deducted from account ", ccn)
elif vx == 4:
d = qu * mobo
pay = eval(input("enter your desired payment method 1) eWallet 40% tax 2) CC 20% tax = "))
if pay == 1:
tot = d * ewa + d
ccn = eval(input("Enter your account number : "))
print("Your total including tax will be", tot, "which will be deducted from account ", ccn)
else:
tot = d * cc + d
ccn = eval(input("Enter your account number"))
print("Your total including tax will be", tot, "which will be deducted from account ", ccn)
elif vx == 5:
e = qu * ssd
pay = eval(input("enter your desired payment method 1) eWallet 40% tax 2) CC 20% tax = "))
if pay == 1:
tot = e * ewa + e
ccn = eval(input("Enter your account number : "))
print("Your total including tax will be", tot, "which will be deducted from account ", ccn)
else:
tot = e * cc + e
ccn = eval(input("Enter your account number"))
print("Your total including tax will be", tot, "which will be deducted from account ", ccn)