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 = input("Your name please?") | |
age = int(input("Please enter your age?")) + 100 | |
print("Your name is "+name+ " and in 100 years you will be "+str(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
num = int(input("Please enter first number")) | |
check = int(input("Please enter second number")) | |
result = check/num | |
if(result % 4 == 0): | |
print ( str(result)+ "\nYour number is a number multiple of 4") | |
elif(result % 2 == 1): | |
print ( str(result)+ "\nYour result is an odd number") | |
else: | |
print ( str(result)+ "\nYour result is an even 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
a = [1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89] | |
num = int(input("Please enter number")) | |
x = [] | |
for element in a: | |
if element < num : | |
x.append(element) | |
print (x) |
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
num = int(input("Please put a number to divide")) | |
divisorList = [] | |
listRange = list(range(1,num+1)) | |
for number in listRange: | |
if num % number == 0: | |
divisorList.append(number) | |
print (divisorList) |
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 | |
a = random.sample(range(50),20) #Sample won't have any duplicate value | |
b = random.sample(range(50),20) | |
#See number that are generated by a | |
print (a) | |
#See number that are generated by b | |
print (b) | |
c = [] |
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
# Strings are list | |
words = str(input("Type in words that you think is palindrome : ")) | |
palindrome = words[::-1] | |
print (words+" "+palindrome) | |
if words == palindrome: | |
print("Your words is palindrome") | |
else : | |
print("Unfortunately this is not palindrome") |
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 | |
number = random.sample(range(50),20) | |
evenNumber = [] | |
print (number | |
) | |
for even in number: | |
if even % 2 == 0: | |
evenNumber.append(even) |
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
<?php | |
if ( is_singular('product') ) { | |
global $post; | |
// get categories | |
$terms = wp_get_post_terms( $post->ID, 'product_cat' ); | |
foreach ( $terms as $term ) $cats_array[] = $term->term_id; | |
$query_args = array( 'post__not_in' => array( $post->ID ), 'posts_per_page' => 5, 'no_found_rows' => 1, 'post_status' => 'publish', 'post_type' => 'product', 'tax_query' => array( | |
array( | |
'taxonomy' => 'product_cat', | |
'field' => 'id', |
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
<?php $chosen_methods = WC()->session->get( 'chosen_shipping_methods' ) ;?> | |
<?php $chosen_shipping = $chosen_methods[0];?> | |
<?php if ($chosen_shipping == 'local_pickup:26') : ?> | |
<p><small>Collect your order and enjoy a 30% voucher off your next in store purchase of artwork</small></p> | |
<?php endif; ?> |
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
<?php | |
switch ($_SERVER['HTTP_HOST']) { | |
case 'www.domain1xx.com.au': | |
case 'domain1xx.com.au': | |
$params = $_SERVER; $params[\Magento\Store\Model\StoreManager::PARAM_RUN_CODE] = 'domain1xx'; | |
$params[\Magento\Store\Model\StoreManager::PARAM_RUN_TYPE] = 'website'; | |
$bootstrap = \Magento\Framework\App\Bootstrap::create(BP, $params); | |
$app = $bootstrap->createApplication('Magento\Framework\App\Http'); | |
$bootstrap->run($app); | |
break; |
OlderNewer