Skip to content

Instantly share code, notes, and snippets.

this_string = input("Input a string: ")
reversed_string = "".join(reversed(this_string))
if this_string == reversed_string:
print("The string you provided is a palindrome.")
else:
print("The string you provided is not a palindrome.")
# Define x
x = 0
# Define for-loop that starts with x and uses the range function to go from 1 to 100
for x in range(1,101):
# Print out "FizzBuzz" if a number in the range is divisible by 3 AND 5
if x%3 == 0 and x%5 == 0:
print("FizzBuzz")
# Print out "Fizz" if a number in the range is divisible by 3
public class CracklePop {
public static void main(String args[]){
for(int num = 1; num <= 100; num++){
if(num % 3 == 0 && num % 5 == 0){
System.out.println("CracklePop");
}else if(num % 3 == 0){
System.out.println("Crackle");
@ltagliaferri
ltagliaferri / AboutMenu
Created February 21, 2014 06:11
Kitchen Cabinet Educational Game Initial Prototype
/**AboutMenu class showing the "About" menu
* Text, picture of host and some of the revolving panel, logo, and logos of social media
* sites that can be used to interact with Kitchen Cabinet through Facebook, Twitter, and Pinterest,
* for example. Logo can also point to an official website.
* Developed using libGDX library
* @author LTagliaferri
* @version 1.0
*/
package com.me.kitchencabinet.screens;
/**
* When the javadoc tool is run over this code, it will bring up the
* HTML maintenance manual.
* @author LTagliaferri
* @version 1.0
*/
public class CountUpExample {
/**
* This method counts up from a specified number
import java.util.Scanner;
import java.util.Random;
public class MagicNumber {
private static void playTheGame(int magicNumber) {
int numberOfTries = 0;
Scanner input = new Scanner(System.in);
int guess;
public class LeapYear {
public static void main (String args[]) {
int year = Integer.parseInt(args[0]);
if ((year % 4 == 0) && (year % 100 != 0)){
System.out.println(year + " is a leap year.");
}
else if ((year % 100 == 0) && (year % 400 == 0)){
System.out.println(year + " is a leap year.");
import java.io.*;
public class BMICalculator {
public static void main(String[] args) {
int i = 100;
String s1 = getInput("Your weight in kg: ");
String s2 = getInput("Your height in cm: ");
@ltagliaferri
ltagliaferri / PlayTheGame
Last active August 29, 2015 13:56
Rock-Paper-Scissors Command Line Game, RockPaperScissors is the class with the main method.
/**RockPaperScissors class creates PlayTheGame contains the methods for
* playing the game of rock paper scissors.
*
* @author Lisa Tagliaferri
*/
import java.util.Random;
import java.util.Scanner;
public class PlayTheGame {
public class BlueRedTower extends Tower {
public BlueRedTower(){
super();
this.name = "Blue Red Tower";
}
public int attackJelly() {
int pointValue = 1;
return pointValue;
}