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
# Write a function named collatz() that has one parameter named number. If number is odd or even | |
#number is even, then collatz() should print number // 2 and return this value. | |
#If number is odd, then collatz() should print and return 3 * number + 1. | |
# First example def of collatz() | |
def collatz( number ): | |
if number % 2 == 0: | |
return " it is even number " | |
else: | |
return "it is an odd 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
#### MIT SOLUTION### | |
#Write a program that counts up the number of vowels contained in the string s. Valid vowels are: 'a', 'e', 'i', 'o' | |
#'u'. For example, if s = 'azcbobobegghakl', your program should print: Number of vowels: 5 | |
s = 'azcbobobegghakl' | |
count = 0 | |
for i in range(0, len(s)): | |
if s[i] == 'a'or s[i] == 'e'or s[i] == 'i'or s[i] == 'o'or s[i] == 'u': | |
count += 1 | |
print("Number of vowels: "+ str(count)) |
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 | |
user= input("Which tarot reading do you want 3(input 3) cards or 7(input 7) cards? or Quit ") | |
### major arcana | |
major = ['The Magician', 'The High Priestess', 'The Empress', 'The Emperor', 'The Hierophant', 'The Lovers', | |
'The Chariot', 'The Strength', 'The Hermit', 'The Wheel of Fortune', 'The Justice', 'The Hanged Man', | |
'The Death', 'The Temperance', 'The Devil', 'The Tower', 'The Star', 'The Moon', 'The Sun', | |
'The Judgement', 'The World', 'The Fool'] | |
### minor arcana pentacle | |
minor_pentancles = ['1p', '2p', '3p', '4p', '5p', '6p', '7p', '8p', '9p', '10p', 'Jp', 'Qp', 'Kp'] | |
minor_wands = ['1w', '2w', '3w', '4w', '5w', '6w', '7w', '8w', '9w', '10w', 'Jw', 'Qw', 'Kw'] |
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
# Task 2 use a print() function with comma separation to combine 2 numbers and 2 strings | |
print("I'm picking you up at",16, "sharp not at ", 17,"Rember!") | |
# Task 3 display text describing an address, made from stings and variables of different | |
street = input ( "What is the name of your street?") | |
str_number = input ("And the number?") | |
print ("So it is", street, str_number) | |
# Task 4[ ] define a variable with a string or numeric value | |
num_newst = 50 |
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
# [ ] review and run example - note the first element is always index = 0 | |
student_name = "Alton" | |
print(student_name[0], "<-- first character at index 0") | |
print(student_name[1]) | |
print(student_name[2]) | |
print(student_name[3]) | |
print(student_name[4]) | |
# [ ] review and run example | |
student_name = "Jin" |
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
''' | |
Created with the help of Python Jumpstart by Building 10 Apps | |
''' | |
import datetime | |
def print_header(): | |
print("----------------------------------") | |
print("BIRTHDAY APP") |
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 requests | |
import bs4 | |
import collections | |
''' | |
Created with the help of Python Jumpstart by Building 10 Apps | |
''' | |
WeatherReport = collections.namedtuple('WeatherReport', | |
'cond, temp, scale, loc') | |
'''' | |
This is the first part where we define teh main function of the program Weather App |
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
''' | |
This is the Journal module | |
created with the help of Python Jumpstart by Building 10 Apps | |
''' | |
import os | |
def load(name): | |
''' | |
This method creates and load new journal |
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
***** | |
*Author: Giorgio Alessandro Motta | |
* | |
***** | |
import datetime | |
import lxml.html as lh | |
import pandas as pd | |
import requests | |
from selenium import webdriver |
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
#### | |
# How to write transaction on Infuria with data by Giorgio Alessandro Motta | |
#### | |
#### | |
# Import | |
#### | |
from web3 import Web3 | |
import json |