Aug-18-2018, 05:26 PM
Hello
Im am learning Python with Coursera.
I run in to a problem. Everything was going well but now I did not receive the information I need to solve this problem.
Write a program that prompts the user to enter an integer and displays that integer. The program should then prompt the user to enter the integer again and display its binary representation.
For example, here are some sample program runs:
Enter an integer >45
45
Enter it again >45
0b101101
You can use the built-in functions named: input, int, bin and print to help you solve this problem. Look at the documentation for the builtin-in functions at python.org.
tip:
Recall that you can apply a function to the result of a function as many times as you like, for example, to print the rounded value of a floating point number that is input as a string, you can use this expression:
print(round(float(input('Enter a decimal number >'))))
Can somebody help me explain what is going on here?
thank you
Im am learning Python with Coursera.
I run in to a problem. Everything was going well but now I did not receive the information I need to solve this problem.
Write a program that prompts the user to enter an integer and displays that integer. The program should then prompt the user to enter the integer again and display its binary representation.
For example, here are some sample program runs:
Enter an integer >45
45
Enter it again >45
0b101101
You can use the built-in functions named: input, int, bin and print to help you solve this problem. Look at the documentation for the builtin-in functions at python.org.
tip:
Recall that you can apply a function to the result of a function as many times as you like, for example, to print the rounded value of a floating point number that is input as a string, you can use this expression:
print(round(float(input('Enter a decimal number >'))))
Can somebody help me explain what is going on here?
thank you