V
V
vitHlJT62b7VCE22018-12-03 17:10:40
Python
vitHlJT62b7VCE2, 2018-12-03 17:10:40

How to adapt a line of code from C# to Python?

How to adapt this line of code

num4 = (int)Math.Round(unchecked(Conversions.ToDouble(Conversion.Oct(Strings.Asc(Conversions.ToString(num4))) + Conversion.Oct(Strings.Asc(@string))) + 666.0));

Under python?
Tried like this
num4 = int(round(float(oct(ord(str(num4))) + oct(ord(string))) + 666.0))

But it gives an error
ValueError: could not convert string to float: '0o600o164'

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question