Skip to content

Instantly share code, notes, and snippets.

x = 5
y = 10
temp = x
x = y
y = temp
print(x)
print(y)
#Task 1:
#Write a program that asks the user for 3 numbers and outputs the average of the numbers.
'''
sum =0
for i in range(1,4):
num = int(input('Enter number {}: '.format(i)))
sum += num
print('Average is: {}'.format(sum/3))
'''
Please follow the TODOs in the code to complete the project
'''
import turtle #use the turtle library
from tkinter import messagebox #tkinter liraray to show a message box
#Set the size of the main window.
turtle.setup(600,600)
#Window size is 600, so we have 300 pixels right and 300 pixels left in the coordinate system.
#(0,0) at the center.
#assume no value for max and second max.
#You may also assume a very small numbers that u r sure will not be in the input data.
maximum = None
second_max = None
for i in range(5):
num = int(input('Enter a number: '))
if i == 0:
maximum = num #consider the first number as the max
#DON'T just look at the code or copy it. Solve it yourself first
import turtle
rex = turtle.Turtle()
rex.color("green")
radius = int(input("Enter the radius of the circle: "))
rex.circle(radius)
import { PersistentVector, PersistentMap } from "near-sdk-core";
@nearBindgen
class Organization {
name: string;
about: string;
orgId: string;
constructor(name: string, about: string, orgId: string) {
this.name = name;
//import your contract code
import { Contract } from "../assembly";
//take an instance of the contract
let contract: Contract;
//make sure the instance is properly created
beforeAll(() => {
contract = new Contract();
});
//take an instance of the contract
let x: number;
//make sure the instance is properly created
beforeEach(() => {
x = 0;
});
describe("add to x", () => {
it("add to x", () => {
use near_sdk::borsh::{self, BorshDeserialize, BorshSerialize};
use near_sdk::collections::Vector;
use near_sdk::near_bindgen;
struct Writing {
pub text: String,
pub sender: String,
pub receiver: String,
}
yarn
yarn test
near login
near dev-deploy
near deploy
near create-account a1.mhassanist.testnet --masterAccount mhassanist.testnet --initialBalance 1
near deploy a1.mhassanist.testnet ./build/release/helloworld.wasm
near call a1.mhassanist.testnet writeSomething '{"message":"Hello Saleh", "toWho":"msaudi.testnet"}' --accountId mhassanist.testnet