Created
December 20, 2015 14:40
-
-
Save ShivamNegi/a695fd84e53c1c2564f7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Python Winter Project | |
Problem 1: | |
Lets see how familiar you have got with strings. | |
Write a “Menu driven” program to check if the input string is a palindrome or not. | |
(Use slicing) | |
Console Output: | |
What would you like to do? | |
1. Enter | |
2. Quit | |
->1 | |
->Enter: Malayalam | |
->Palindrome | |
What would you like to do? | |
1. Enter | |
2. Quit | |
->2 | |
->Not Palindrome | |
Problem 2: | |
You must make a rock paper scissors game | |
Goal | |
• Ask the player if they pick rock paper or scissors | |
• Have the computer chose its move | |
• Compare the choices and decide who wins | |
• Print the results | |
• Repeat. | |
Problem 3: | |
Input a number from the user. Convert it to binary. Print the result. | |
I) Take the ones complement of the binary value. Print the result. | |
II) Converted the new binary value into decimal. Print the result. | |
Console Output: | |
Enter: 36 | |
->Binary: 100100 | |
->Complement Binary: 011011 | |
->Decimal: 27 | |
(Note: Try using the inbuilt python functions for the problems.) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Make a single gist of your solutions, one below the other and post its link as a comment in the facebook post.