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
<body> | |
<h1>Learn JSON</h1> | |
<div id="output"></div> | |
<form id="myForm"> | |
<input type="text" name="first" value="Laurence"><br> | |
<input type="text" name="last" value="Svekis"><br> | |
<input type="text" name="email" value="test@test.com"><br> | |
<input type="text" name="company" value="Discoveryvip"><br> | |
<input type="submit" value="submit"> | |
</form> |
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
<body> | |
<h1>Learn JSON</h1> | |
<div id="output"> | |
<ul id="taskList"></ul> | |
</div> | |
<script type="text/javascript"> | |
var data = '{"tasks":{"Cut Grass":true,"Clean Room":false,"Go to Gym":true,"Make Dinner":false}}'; | |
var dataJSON = JSON.parse(data); | |
var output = document.getElementById('output'); |
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 = 'abdullah imran' | |
if name == 'jahangir': | |
prnt('Hi, jahangir') | |
else: | |
print('Hello, abdullah imran') | |
# output: Hello, abdullah imran |
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('Please enter name : ') | |
name = input() | |
print('Enter your age : ') | |
age = input() | |
age = int(age) | |
if name == 'alice': | |
print('Hi, alice') |
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('Please enter name : ') | |
name = input() | |
print('Enter your age : ') | |
age = input() | |
age = int(age) | |
if name == 'alice': | |
print('Hi, alice') |
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
spam = 0 | |
while spam < 5: | |
print('Hello, world.') | |
spam = spam+1 | |
'''output | |
Hello, world. | |
Hello, world. | |
Hello, world. | |
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
name = '' | |
while name != 'jahangir': | |
print('Please type your name.') | |
name = input() | |
print('Thank you!') | |
'''output | |
Please type your name. | |
ja | |
Please type your name. |
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
while True: | |
print('Please type your name : ') | |
name = input() | |
if name == 'your name': | |
break | |
print('Thank you !') | |
'''output: | |
Please type your name : | |
rayhan sarkar |
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
while True: | |
print('Who are you?') | |
name = input() | |
if name != 'Joe': | |
continue | |
print('Hello, Joe. What is the password? (It is a fish.)') | |
password = input() | |
if password == 'swordfish': | |
break | |
print('Access granted.') |
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('My name is') | |
for i in range(5): | |
print('Jimmy Five Times (' + str(i) + ')') | |
'''output | |
My name is | |
Jimmy Five Times (0) | |
Jimmy Five Times (1) | |
Jimmy Five Times (2) | |
Jimmy Five Times (3) |
OlderNewer