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
fn main() { | |
println!("Hello World!"); | |
} |
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
def canDrive(): | |
age = input("What's your age? ") | |
if int(age) >= 18: | |
print(True) | |
else: | |
print(False) | |
canDrive() |
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 'dart:io'; | |
void main() { | |
gradeCheck() { | |
stdout.write("What is your grade, from 0-10?"); | |
String? grade = stdin.readLineSync(); | |
if (grade != null); { | |
int totalGrade = int.parse(grade!); | |
if (totalGrade == 0) { | |
print("You failed the test, try harder next time!"); |
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
def gradeCheck(): | |
grade = input("What grade did your get? (0-10): ") | |
if int(grade) == 0: | |
print("You failed the exam, better luck next time!") | |
elif int(grade) <= 5: | |
print("You still didn't pass but did decent.") | |
elif int(grade) < 10: | |
print("Nice job! You passed!") | |
if int(grade) == 10: | |
print("And you got a 10! Keep up that good job!") |
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
var number = input("Please type a number, any number. ('Till 1M)"); | |
if (number == 0) { | |
print("Why 0?"); | |
} else if (number <= 10) { | |
print("Nice number, it's small."); | |
} else if (number <= 100) { | |
print("Starting to get somewhat big."); | |
} else if (number <= 1000) { | |
print("Going up."); |
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
#include <iostream> | |
int main() { | |
std::cout << "Hello World!"; | |
return 0; | |
} | |
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 'dart:io'; | |
void main() { | |
print("Number 1: "); | |
String? number1 = stdin.readLineSync(); | |
print("Analyzing..."); | |
sleep(Duration(seconds: 5)); | |
print("Done!"); | |
sleep(Duration(seconds: 1)); | |
print("Number 2: "); |
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
print("Welcome!") | |
guess = input("Guess the Word! (Clue: It has 9 letters) (Capitalized) ") | |
word = "Brilliant" | |
if guess == word: | |
print(f"Congratulations, {word} was the word!") | |
else: | |
print(f"Sorry, {guess} wasn't the word.") | |
print("Now we will do some maths! (very simple actually)") | |
userNum = input("What is the result of '24 * 58 / 5 + 251'? ") |
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 'dart:io'; | |
void main() { | |
var word = "Random"; | |
print("Guess the word!"); | |
String? userGuess = stdin.readLineSync(); | |
if (userGuess != null) { | |
if (userGuess == word) { | |
print("Congrats, the word was Random!"); | |
} else if (userGuess != word) { |
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
use std::io; | |
use rand::Rng; | |
use std::cmp::Ordering; | |
fn main() { | |
println!("Guess the number!"); | |
let secret_number = rand::thread_rng().gen_range(1..=100); | |
loop { | |
println!("The secret number is: between 1-100 and randomly generated!"); |