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
# format()的用法 | |
name = 'Kevin' | |
age = 28 | |
job = 'Software Developer' | |
hobby = 'coding' | |
# 變數名稱跟要插入的變數一樣 | |
line = 'Hi there, I am {name}, {age} years old. Currently working as a {job}, my hobby is {hobby}'.format(name=name, age=age, job=job, hobby=hobby) | |
# 暫時性替代變數名稱 |
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
name = 'Kevin' | |
age = 28 | |
job = 'Software Developer' | |
hobby = 'coding' | |
print( | |
'Hi there, I am {name}, {age} years old. Currently working as a {job}, my hobby is {hobby}'.format( | |
name=name, | |
age=age, | |
job=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
name = 'Kevin' | |
age = 28 | |
print('Hello, my name is %s, and I am %s years old' % (name, age)) |
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
name = 'Kevin' | |
age = 28 | |
print('Hello, my name is ' + name + ', and I am ' + age + ' old.') |
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 random | |
def generate_random_number(): | |
num = [str(i) for i in range(10)] | |
random.shuffle(num) | |
return ''.join(num[0:4]) | |
print(generate_random_number()) |
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('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
const fs = require('fs'); | |
const line = `oid | |
batchNo | |
vendorId | |
channelId | |
storeId | |
siteId | |
transDate | |
posNos |
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
const fs = require('fs'); | |
const line = `OID | |
BATCH_NO | |
VENDOR_ID | |
CHANNEL_ID | |
STORE_ID | |
SITE_ID | |
TRANS_DATE | |
POS_NOS |
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:flutter/material.dart'; | |
void main() => runApp(MyApp()); | |
class MyApp extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return MaterialApp(home: ExpenseApp()); | |
} | |
} |
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:flutter/material.dart'; | |
final Color darkBlue = Color.fromARGB(255, 18, 32, 47); | |
void main() => runApp(ToDoApp()); | |
class ToDoApp extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return MaterialApp( |