Gmail, one of the most popular email services in the world, supports millions of users, delivering robust performance, high availability, and strong security...
Introduction. Have you ever wondered how to build a scalable system like the one you use most for interview practice? Leetcode has become a cornerstone for s...
Introduction:. In today's mobile-first world, having a website that performs seamlessly on mobile devices is no longer optional—it's imperative. Mobile optim...
Create the Lazy-Loaded Component. In the application, add a new component using the Angular CLI command, as shown below.
Basic Introduction. Nodejs is a JavaScript runtime build over Chrome's V8 JavaScript engine. Nodejs is generally used a backend tool to cater to client apis.
At times we must have come across a situation wherein we had to scrap a website and process the data in some way, like. ,
def listsum(a,b): print("Sum: ",(a+b)) listsum(10,20)
def listsum(a,b): print("Sum: ",(a+b)) listsum(10,20)
#include<iostream> #include <string> using namespace std; class Prostokat { float x, y; string nazwa; public: friend void sedzia(); } Class Kwadrat { float x, y, szerokosc, wysokosc; string nazwa; public: friend void sedzia(); } int main() { return 0; }
import random def calcul_pourboire(): montant = float(input("Entrez le montant de la facture : ")) print("Choisissez un pourcentage de pourboire :") print("1. 15%\n2. 18%\n3. 20%\n4. Personnalisé") choix = input("Votre choix : ") if choix == '1': pourboire = montant * 0.15 elif choix == '2': pourboire = montant * 0.18 elif choix == '3': pourboire = montant * 0.20 elif choix == '4': pourcentage = float(input("Entrez le pourcentage de pourboire : ")) / 100 pourboire = montant * pourcentage else: print("Choix invalide.") return total = montant + pourboire print("Pourboire :", round(pourboire, 2), ", Total :", round(total, 2)) def conversion_unites(): print("1. Kilomètres ↔ Miles\n2. Celsius ↔ Fahrenheit\n3. Livres ↔ Kilogrammes\n4. Mètres ↔ Pieds\n5. Litres ↔ Gallons") choix = input("Votre choix : ") valeur = float(input("Entrez la valeur : ")) if choix == '1': print(valeur, "km =", valeur * 0.621371, "miles") elif choix == '2': print(valeur, "C =", valeur * 9 / 5 + 32, "F") elif choix == '3': print(valeur, "lbs =", valeur * 0.453592, "kg") elif choix == '4': print(valeur, "m =", valeur * 3.28084, "pieds") elif choix == '5': print(valeur, "L =", valeur * 0.264172, "gallons") else: print("Choix invalide.") def calcul_mathematique(): num1 = float(input("Entrez le premier nombre : ")) operateur = input("Choisissez une opération (+, -, *, /, sqrt) : ") if operateur == 'sqrt': print("La racine carrée de", num1, "est", num1 ** 0.5) else: num2 = float(input("Entrez le deuxième nombre : ")) if operateur == '+': print(num1 + num2) elif operateur == '-': print(num1 - num2) elif operateur == '*': print(num1 * num2) elif operateur == '/': print(num1 / num2) else: print("Opération invalide.") def conversion_monnaie(): taux = { "USD": 0.74, "EUR": 0.68, "GBP": 0.58, "JPY": 81.45, "MXN": 13.57, "CAD": 1.00 } montant = float(input("Entrez le montant en CAD : ")) devise = input("Convertir en (USD, EUR, GBP, JPY, MXN, CAD) : ").upper() if devise in taux: print(montant, "CAD =", montant * taux[devise], devise) else: print("Devise non prise en charge.") def generateur_nombre(): min_val = int(input("Entrez la valeur minimale : ")) max_val = int(input("Entrez la valeur maximale : ")) print("Nombre aléatoire :", random.randint(min_val, max_val)) def menu(): while True: print("\nBienvenue dans la Super Calculatrice Scientifique!") print("Que souhaitez-vous faire?") print("1. Calculer un pourboire") print("2. Convertir des unités") print("3. Effectuer un calcul mathématique") print("4. Convertir des devises") print("5. Générer un nombre aléatoire") print("6. Quitter") choix = input("Choisissez un nombre entre (1-6) : ") if choix == '1': calcul_pourboire() elif choix == '2': conversion_unites() elif choix == '3': calcul_mathematique() elif choix == '4': conversion_monnaie() elif choix == '5': generateur_nombre() elif choix == '6': print("Au revoir!") break else: print("Choix invalide. Veuillez choisir un numéro de (1 à 6).") menu()
secret_number = 9 guess_limit = 3 guess_count = 0 while guess_count < guess_limit: guess = int(input("Guess: ")) guess_count += 1 if guess == secret_number: print("Congratulations!") break else: print("Whoops you lost!")
def listsum(a,b): print("Sum: ",(a+b)) listsum(10,20)