translation from pascal to python

guys i need help to translate this code from pascal to python!!!!!! program ex02; var a,b:real; begin writeln('entrer la valeur de a et b: '); readln(a,b); if (a=0) then if (a=0) then writeln ('S=R') else writeln ('pas de solution') else writeln('S=', -b/a) End.

12th Nov 2022, 7:24 AM
KERLEXGOD - avatar
2 Answers
+ 7
Doesn't look so difficult. Do you have your code where you are stuck? Can you attach it here please?
12th Nov 2022, 8:52 AM
Ausgrindtube - avatar
KERLEXGOD , This is close to pascal's print('entrer la valeur de a et b: \n'); a = float(input()) b = float(input()) if a==0: print('S=R\n') else: print(f'Sn {-b/a}\n') https://www.sololearn.com/compiler-playground/cbvtxqZroMHT
12th Nov 2022, 2:09 PM
SoloProg - avatar