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
"""Bagels, by Al Sweigart al@inventwithpython.com | |
A deductive logic game where you must guess a number based on clues. | |
This and other games are available at https://nostarch.com/XX | |
A version of this game is featured in the book, "Invent Your Own | |
Computer Games with Python" https://nostarch.com/inventwithpython | |
Tags: short, game, puzzle game""" | |
__version__ = 0 | |
import random | |
NUM_DIGITS = 3 # (!) Try setting this to 1 or 10. |
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
a=int(input("Enter the number of terms: ")) | |
k=0 | |
print("Enter",a,"terms: ") | |
for i in range(1,a+1): | |
ai=int(input()) |
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
public class Main { | |
public static void main(String[] args) { | |
int rows = 5; | |
for (int i = 1; i <= rows; ++i) { | |
for (int j = 1; j <= i; ++j) { |
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
import java.util.Scanner; | |
public class Main { | |
public static void main(String[] args) { | |
// Create a Scanner object to read input from the user | |
Scanner scanner = new Scanner(System.in); | |
// Ask the user to enter the first number | |
System.out.print("Enter the first number: "); | |
System.out.println("<get-input>");int num1 = scanner.nextInt(); |
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
x = input("Type a number: ") | |
y = input("Type another number: ") | |
sum = int(x) + int(y) | |
print("The sum is: ", sum) |
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
import 'package:demo_project/provider/home_provider.dart'; | |
import 'package:firebase_core/firebase_core.dart'; | |
import 'package:flutter/material.dart'; | |
import 'package:provider/provider.dart'; | |
void main() async { | |
WidgetsFlutterBinding.ensureInitialized(); | |
await Firebase.initializeApp( | |
options: const FirebaseOptions( | |
apiKey: "", // add your secrets here! |