📌 𝐏𝐫𝐨𝐠𝐫𝐚𝐦 : Hello World
🧠 𝐃𝐞𝐬𝐜𝐫𝐢𝐩𝐭𝐢𝐨𝐧 :
The classic beginner program — print "Hello World"
👁️ 𝐎𝐮𝐭𝐩𝐮𝐭 :
🧠 𝐃𝐞𝐬𝐜𝐫𝐢𝐩𝐭𝐢𝐨𝐧 :
The classic beginner program — print "Hello World"
👁️ 𝐎𝐮𝐭𝐩𝐮𝐭 :
Hello, World!public class Main {
public static void main(String[] args) {
System.out.println("Hello, World!");
}
}#include <iostream>
using namespace std;
int main() {
cout << "Hello, World!";
return 0;
}
using System;
class Program {
static void Main() {
Console.WriteLine("Hello, World!");
}
}
📌 Program Title : Check if a number is Even or Odd
🧠 Description :
This program checks whether a given integer is even or odd. An even number is divisible by 2, while an odd number is not. The user is prompted to enter an integer, and the program outputs either "Even" or "Odd" based on the result.
📥 Input: An integer (e.g., 7)
📤 Output: A single word:
"Even" – if the number is divisible by 2
"Odd" – otherwise
🧪 Example:
🧠 Description :
This program checks whether a given integer is even or odd. An even number is divisible by 2, while an odd number is not. The user is prompted to enter an integer, and the program outputs either "Even" or "Odd" based on the result.
📥 Input: An integer (e.g., 7)
📤 Output: A single word:
"Even" – if the number is divisible by 2
"Odd" – otherwise
🧪 Example:
Input: 4
Output: Evennum = int(input("Enter a number: "))
if num % 2 == 0:
print("Even")
else:
print("Odd")import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int num = sc.nextInt();
if (num % 2 == 0)
System.out.println("Even");
else
System.out.println("Odd");
}
}
let num = parseInt(prompt("Enter a number:"));
if (num % 2 === 0) {
console.log("Even");
} else {
console.log("Odd");
}#include <stdio.h>
int main() {
int num;
scanf("%d", &num);
if (num % 2 == 0)
printf("Even\n");
else
printf("Odd\n");
return 0;
}
#include <iostream>
using namespace std;
int main() {
int num;
cin >> num;
if (num % 2 == 0)
cout << "Even";
else
cout << "Odd";
return 0;
}
OverAPI provides cheat sheets for multiple programming languages and technologies in one place. It’s especially useful for quick syntax reference while coding or revising concepts
You can find concise guides for languages and tools like JavaScript, Python, Java, PHP, SQL, HTML, CSS, and more — all organised in an easy-to-read format
This resource is ideal for students, developers, and anyone who wants to code faster without constantly searching documentation
For more useful coding resources, tools, and tech discoveries, feel free to follow the page
You can find concise guides for languages and tools like JavaScript, Python, Java, PHP, SQL, HTML, CSS, and more — all organised in an easy-to-read format
This resource is ideal for students, developers, and anyone who wants to code faster without constantly searching documentation
For more useful coding resources, tools, and tech discoveries, feel free to follow the page
Overapi
OverAPI.com | Collecting all the cheat sheets
OverAPI.com is a site collecting all the cheatsheets,all!
import telebot
from telebot.types import ReplyKeyboardMarkup, KeyboardButton, InlineKeyboardMarkup, InlineKeyboardButton
token = '68613996:AAFG6d8Q92kKqzG8kY7Negg7sCT83ApBEP8' #bot token from @botfather
bot = telebot.TeleBot(token)
@bot.callback_query_handler(func=lambda call: True)
def callback_inline(call):
if call.data == 'test':
bot.send_message(call.message.chat.id, 'You clicked on Test Callback (Inline) Button')
@bot.message_handler(commands=['start'])
def start(message):
bot.send_message(message.chat.id, 'Hello!')
markup = ReplyKeyboardMarkup(resize_keyboard=True)
markup.add(KeyboardButton('Test'))
bot.send_message(message.chat.id, 'Hello choose a button',reply_markup=markup)
@bot.message_handler(commands=['inline'])
def inline_key(message):
markup = InlineKeyboardMarkup()
markup.add(InlineKeyboardButton('Test', callback_data='test'))
bot.send_message(message.chat.id, 'Hello choose a button',reply_markup=markup)
@bot.message_handler(content_types=['text'])
def msg_handler(message):
user_id = message.chat.id
if message.text == 'Test':
bot.reply_to(message,"You choosen Test Button")
return
bot.send_message(user_id,message.text)
bot.polling(non_stop=True)
Designing APIs for humans: Object IDs 🧑🏻💻
Ever wondered why Stripe uses foloowing format to generate unique IDs? Let’s dive in and break down how and why Stripe IDs are structured the way they are:
pi_3LKQhvGUcADgqoEM3bh6pslE
└┘└────────────┘
└─ Prefix └─ Randomly generated characters
You might have noticed that all Stripe Objects have a prefix at the beginning of the ID. The reason for this is quite simple: adding a prefix makes the ID human readable. ✔️
Without knowing anything else about the ID we can immediately confirm that we’re talking about a PaymentIntent object here, thanks to the pi_ prefix. This helps Stripe employees internally just as much as it helps developers integrating with Stripe.
The above snippet is trying to retrieve a PaymentIntent from a connected account, however without even looking at the code you can immediately spot the error: a Customer ID (cus_) is being used instead of an Account ID (acct_). 🔖
Without prefixes this would be much harder to debug; if Stripe used UUIDs instead then we’d have to look up the ID to find out what kind of object it is and if it’s even valid 👨💻
Ever wondered why Stripe uses foloowing format to generate unique IDs? Let’s dive in and break down how and why Stripe IDs are structured the way they are:
pi_3LKQhvGUcADgqoEM3bh6pslE
└┘└────────────┘
└─ Prefix └─ Randomly generated characters
You might have noticed that all Stripe Objects have a prefix at the beginning of the ID. The reason for this is quite simple: adding a prefix makes the ID human readable. ✔️
Without knowing anything else about the ID we can immediately confirm that we’re talking about a PaymentIntent object here, thanks to the pi_ prefix. This helps Stripe employees internally just as much as it helps developers integrating with Stripe.
$pi = $stripe->paymentIntents->retrieve(
$id,
[],
['stripe_account' => 'cus_1KrJdMGUcADgqoEM']
);
The above snippet is trying to retrieve a PaymentIntent from a connected account, however without even looking at the code you can immediately spot the error: a Customer ID (cus_) is being used instead of an Account ID (acct_). 🔖
Without prefixes this would be much harder to debug; if Stripe used UUIDs instead then we’d have to look up the ID to find out what kind of object it is and if it’s even valid 👨💻