Please note, this is a STATIC archive of website www.tutorialspoint.com from 11 May 2019, cach3.com does not collect or store any user information, there is no "phishing" involved.
Tutorialspoint

Execute Python Online

# Calculator
import sys
infiniteLoop = "true"
while(infiniteLoop == "true"):
    operator = input("Would you like to add (a), subtract (s), multiply (m), or divide (d)")
    if (operator == "a"):
        add1 = raw_input("Enter 1st number: ")
        add2 = raw_input("Enter number you would like to add: ")
        answer = add1 + add2
        print(answer)
        newEquation = raw_input("Would you like to enter new equation (e) or continue this one (c), or are you finished (n)?")
        if(newEquation == "e"):
            continue
        else:
            break
    elif (operator == "s"):
        subtract1 = raw_input("Enter 1st number: ")
        subtract2 = raw_input("Enter number you would like to subtract: ")
        answer = subtract1 - subtract2
        print(answer)
        newEquation = raw_input("Would you like to enter new equation (e) or continue this one (c), or are you finished (n)?")
        if(newEquation == "e"):
            continue
        else:
            break
    elif (operator == "m"):
        multiply1 = raw_input("Enter 1st number: ")
        multiply2 = raw_input("Enter number you would like to add: ")
        answer = multiply1 * multiply2
        print(answer)
        newEquation = raw_input("Would you like to enter new equation (e) or continue this one (c), or are you finished (n)?")
        if(newEquation == "e"):
            continue
        else:
            break
    elif (operator == "d"):
        divide1 = raw_input("Enter 1st number: ")
        divide2 = raw_input("Enter number you would like to add: ")
        answer = divide1 / divide2
        print(answer)
        newEquation = raw_input("Would you like to enter new equation (e) or continue this one (c), or are you finished (n)?")
        if(newEquation == "e"):
            continue
        else:
            break
    else:
        print("Sorry, that is not a defined operator")

Execute Python Online

import matplotlib.pyplot as plt
def F(t,z):
    return -10*t+10
def euler(F,t0,tf,y0,n):
    t=t0
    y=y0
    h=(tf-t0)/float(n)
    temps=[t0]
    fonction=[y0]
    for i in range(n):
        y=y+h*F(t,y)
        t=t+h
        temps.append(t)
        fonction.append(y)
    plt.plot(temps,fonction)
    return fonction
print(euler(F,0,3,0,50))

Execute Python Online

# Hello World program in Python
    
print "Hello World!\n"

Execute Python Online

import numpy as np
import matplotlib.pyplot as plt
import os as os
#deg=0
Cd_deg_0=np.loadtxt('base_de_donne/Re_100_deg_0/x-hydroForce_time.res',delimiter=' ')
Cz_deg_0=np.loadtxt('base_de_donne/Re_100_deg_0/z-hydroForce_time.res',delimiter=' ')

Cd_stable_deg_0=[]
Cz_stable_deg_0=[]
for i in range(len(Cd_deg_0)):
    if Cd_deg_0[i,0]>=25.9104 :
         Cd_stable_deg_0.append(Cd_deg_0[i,1])
         Cz_stable_deg_0.append(Cz_deg_0[i,1])        

plt.figure(1)
plt.plot(Cz_stable_deg_0,Cd_stable_deg_0)
plt.show()

123iyiuikkakiimmdsajjdsaffreszzsasdefrccx

# Hello World program in Python
    
print "Hello World!\n"

__vpnfetcher-vpnbook__efwefwefwefwefwef

from urllib2 import urlopen
import re
import subprocess 

pagesrc = urlopen("https://www.vpnbook.com").read()
password = re.search('\<strong\>Password: (\w+)',pagesrc).group(1)
print("Today's Password is: " + password)

# Factorial function: # Input: n # Output: n! # def factorial (n): if (n <= 1): return 1 i = 1 product = 1 while (i <= n): product = product * i i = i + 1 return product

def factorial (n):
	if (n <= 1):
		return 1

	i = 1
	product = 1
	while (i <= n):
		product = product * i
		i = i + 1

	return product

Execute Python Online

userName=raw_input('Please enter your name:')     
age=input('Please enter your age:')

factor=2
finalAge=age+factor
multAge=age*factor
divAge=age/factor

print('In', factor, 'years your age will be', finalAge, 'years old', userName)
print('Your age muliply by', factor, 'is', multiAge)
print('Your age divided by', factor, 'is', divAge)

Execute Python Online

a = 5
print(a,"is of type",type(a))

a=2.0
print(a,"is of type",type(a))

a=1+2j
print(a,"is of type",type(a))


    
            

restartsshservertochinaindaocloud

# Hello World program in Python
import requests

result = requests.post('https://openapi.daocloud.io/v1/apps/28832ce5-0e21-42a2-8307-796a85045c3e/actions/restart',
  headers={"Authorization": "token q4c67rdvmtmkgee4hwgr3efj2vj0ucw7v74qk6qk"})

print(result.json())

Advertisements
Loading...

We use cookies to provide and improve our services. By using our site, you consent to our Cookies Policy.