Python | Revision test | Chemistry

/ 22 Aug 2013 /
Hopefully this will help me



while 1:
    a = 'NaCO3 + 2HCl -> 2NaCl + H2O + CO2'
    b = 'Pb(NO3) + 2Kl -> Pbl2 + 2KNO3'
    c = 'Zn + 2HCl -> ZnHCl2 + H2'

    aa = input("What's the WE for Sodium carbonate + Hydrochloric acid? ")
    if aa == a:
        print('correct!')
    else:
        print('no')

    bb = input("What's the WE for Pottasium iodide + Lead nitrate?  ")
    if bb == b:
        print('correct!')
    else:
        print('no')
 
    cc = input('What\'s the WE for Hydrochloric acid + Zinc metal? ')
    if cc == c:
        print('correct!')
    else:
        print('no')
 
Copyright © 2010 M(ath)+me, All rights reserved