The Student Room Group

python programming ks3

You are required to write an algorithm that will ask a user a binary question. Eg: what is the binary number 101 in denary? The user is allowed three attempts to get it correct.Using the 'for' loop code that you have been given, write a 'for' loop that asks a user a Maths or binary conversion question.After three attempts the program will stop.
u want the answer... or?
Reply 2
Original post by SHADOW_SCRIPT
u want the answer... or?

yes i would like the answer
well that's not much effort from ur side, but k
(pondering on whether or not to give fill in the blanks)
(click reply, to see the exact code with indents)
im guessing u know which window to use (not the shell one), so here:

question = int(input('what is the number 10010 in denary?'))
ans = 18
for i in range (2):
question = int(input('what is the number 10010 in denary?'))
if question == ans:
break
(edited 3 years ago)

Quick Reply

Latest

Trending

Trending