Skip to content

Instantly share code, notes, and snippets.

@ShivamNegi
Created December 20, 2015 14:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ShivamNegi/a695fd84e53c1c2564f7 to your computer and use it in GitHub Desktop.
Save ShivamNegi/a695fd84e53c1c2564f7 to your computer and use it in GitHub Desktop.
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.)
@ShivamNegi
Copy link
Author

Make a single gist of your solutions, one below the other and post its link as a comment in the facebook post.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment