What do you want to save?
Add Code snippet
New code examples
-
Python 2021-10-26 06:36:13
Write a code with function getFare(String Source, String Destination) which take Input as source and destination stops(in the format containing first two characters of the Name of the Bus Stop) and calculate and return travel fare.
BusStops = [ "TH", "GA", "IC", "HA", "TE", "LU", "NI","CA" ] Path = [800, 600, 750, 900, 1400, 1200, 1100, 1500] s, d = input(), input() if s not in BusStops or d not in Bus... Add solution -
Python 2021-10-26 04:32:07
raspberry pi keyboard python input
import tty, sys, termios filedescriptors = termios.tcgetattr(sys.stdin) tty.setcbreak(sys.stdin) x = 0 while 1: x=sys.stdin.read(1)[0] print("You pressed", x) if x == "r": print("If condition is met") termios.tcset... Add solution -
Swift 2021-10-25 22:11:08
countdown timer using swift StackOverflow
@IBAction func start(sender: UIButton) { self.timer = NSTimer.scheduledTimerWithTimeInterval(1.0, target: self, selector: #selector(ViewController.update(_:)), userInfo: nil, repeats: true) NSRunLoop.currentRunLoop().addTimer(self.timer, forMode... Add solution -
C# 2021-10-25 07:46:11
*ngif vs ngif
ngIf is the directive. Because it's a structural directive (template-based), you need to use the * prefix to use it into templates. *ngIf corresponds to the shortcut for the following syntax ("syntactic sugar"): <template [ngIf]="condi... Add solution -
Python 2021-10-25 04:12:16
What's the difference between a statement and an expression in Python?
#Here’s a general rule of thumb: If you can print it, or assign it to a #variable, it’s an expression. If you can’t, it’s a statement. #Here are some examples of expressions: 2 + 2 3 * 7 1 + 2 + 3 * (8 ** 9) - sqrt(4.0) min(2,... Add solution