Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

Python

Python is an interpreted, high-level, 
general-purpose programming language.

//as you can also see to your right --------------------->

but also note interpreted, not compiled. 
Comment

python

Python is an interpreted high-level general-purpose programming language. Its design philosophy emphasizes code readability with its use of significant indentation. Its language constructs as well as its object-oriented approach aim to help programmers write clear, logical code for small and large-scale projects.
Comment

python

Whether you're new to programming or an experienced developer, it's easy to learn and use Python.
Comment

python

Fun fact, python is older than java :)
Comment

python

Python is a high-level, interpreted, general-purpose programming language.
Its design philosophy emphasizes code readability with the use of significant
indentation. Python is dynamically-typed and garbage-collected. 
Comment

python

wise choice for beegginers!
Comment

python

Once you master python, it will be a comdedian. Because its full of one liners
Comment

python

Go to python.org
Comment

python

# Very simple and easy to learn language. Definitely has scope in the future!

# By Codexel
Comment

python

print("hello world")
x = input("type something here : ")
#THis is a comment
"""
this is a big
c
o
m
m
e
n
t
"""
Comment

python

python is a programming language
Comment

python

www.python.org
Comment

python

library(dash)
library(dashCoreComponents)
library(dashHtmlComponents)

app <- Dash$new()

app$layout(
  htmlDiv(
    list(
      dccInput(id='input-1-state', type='text', value='Montreal'),
      dccInput(id='input-2-state', type='text', value='Canada'),
      htmlButton(id='submit-button', n_clicks=0, children='Submit'),
      htmlDiv(id='output-state')
    )
  )
)


app$callback(output(id = 'output-state', property = 'children'),
             list(input(id = 'submit-button', property = 'n_clicks'),
                  state(id = 'input-1-state', property = 'value'),
                  state(id = 'input-2-state', property = 'value')),
             function(n_clicks, input1, input2) {
               sprintf("The Button has been pressed "%s" times, Input 1 is "%s", and Input 2 is "%s"", n_clicks, input1, input2)
             })

app$run_server()
Comment

python

name = input("write your name: ")
print(f"Hello {name} :D") 
Comment

oython

# a great programming language emphasizing readibility and easy syntax words.

print("Hello World!")
Comment

python

display('df1', 'df2', "pd.merge(df1, df2, on='employee')")
Comment

python

print("Hello! This is Python! This is an amazing software for you to code on!")
print("Don't worry! You'll be good soon!")
print("For more info, visit https://python.org")
Comment

python

Welcome to our world.
Comment

python

# Python 3: Simple arithmetic
>>> 1 / 2
0.5
>>> 2 ** 3
8
>>> 17 / 3  # classic division returns a float
5.666666666666667
>>> 17 // 3  # floor division
5
Comment

python

//Nice choice!
Comment

python

print('Hello World boi')
Comment

python

#declaring different type of variables in python
variable1 = "value" # string
variable2 = 1000000 # integer
variable3 = 10000.0 # real/float
variable4 = True # boolean: True or False
Comment

python

'''Python is an interpreted, high-level and general-purpose programming
language.Python's design philosophy emphasizes code readability with its 
notable use of significant whitespace. '''
#Examples
print("Hello World")
repeat = 5
for i in range(repeat):  
  print("This is the %i iteration" % i)
  #2nd variation - print("This is the " + i + "iteration")
  #3rd variation - print(f"This is the {i!r} iteration")
  #4th variation - print(("This is the {} iteration).format(i))
  
    import random #In order to use the random functions
    class Person:
      def __init__(self, name, age, height):
        self.name = str(name)
        self.age = int(age)
        self.height = str(height)
    person1 = Person("Name", random.randint(1, 100), str(random.randint(0, 7)) + "'" + str(random.randint(0, 11)) + '"')
    print(f"Your name is {person1.name} and you are {person1.age} years old. You are also {person1.height}.")
Comment

python

Here is a basic Python function print('Hello')
Comment

python

this is a pogchamp moment
Comment

python

Welcome TO python 
print('hello')
Comment

python

from _future_ import print_function
import matplotlib.pyplot as plt
import os
import sys
import re
import gc

# Selection of features following "Writing mathematical expresion"tutorial
mathtext_tiles = {
    0: "Header demo"
    1: "Subscripts and superscripts"
    2: "Fraction ,bionomals and stacked numbers"
    3: "radicals"
    4: "Fonts"
    5: "Accents"
    6: "Greek Herbew"
    7: "Delimeters, functions and symbols"}
n_lines = len(mathtext_titles)
Comment

python

if you want to download python use https://www.python.org/downloads/
Comment

python

hey!!!
Comment

python

Python is an interpreted, high-level and general-purpose programming language. Created by Guido van Rossum and first released in 1991, Python's design philosophy emphasizes code readability with its notable use of significant whitespace.
Comment

python

best programming language
Comment

python

class PrintHello:
  def printnow(self, message):
    self.message = message
    print(message)
 
printer = PrintHello()
printer.printnow("hey")
#completely useless
Comment

python

Learn python now ! 
Comment

python

high level programming language

very easy, recommended for beginners
Comment

python

#High-level programming language
Comment

python .

Python is a programming language.
Nothing more, nothing less.
Comment

python

dang that snake looks scary
Comment

python

#1) To type a string using the keyboard module:
#pip install keyboard
import keyboard
string = "This is what I typed"
keyboard.write(string)

#2) To check if an object is of the type 'str' (to check if the object is a string):
if type(object) == str:

#3) To print a string:
string = "This is displayed in your Big Black Console"
print(string)
Comment

python

# a comment
myVar = 5
avar = 53
tr = 13 # vars

while True:
  #code for while true loop
Comment

Python

Python is an interpreted, high-level, general-purpose programming language.

Created by Guido van Rossum and first released in 1991, Python's design
philosophy emphasizes code readability with its notable use of significant
whitespace.
Comment

python

n = int(input('Type a number, and its factorial will be printed: '))

if n < 0:
    raise ValueError('You must enter a non negative integer')

fact = 1

for i in range(2, n + 1):
    fact *= i

print(fact)
Comment

python

   Y
  .-^-.
 /           .- ~ ~ -.
()     ()    /   _ _   `.                     _ _ _
 \_   _/    /  /                        . ~  _ _  ~ .
   | |     /  /                       .' .~       ~-. `.
   | |    /  /         )   )           /  /             `.`.
    \_ _/  /         /   /           /  /                `'
    \_ _ _.'         /   /           (  (
                    /   /               
                   /   /                 
                  /   /                 )  )
                 (   (                 /  /
                  `.  `.             .'  /
                    `.   ~ - - - - ~   .'
                       ~ . _ _ _ _ . ~
Comment

python

print("Download Right Now or else Guido Gonna one punch you")
Comment

python

Congratulations My friend!!! 
You are going to take your first step into the world of PYTHON!!!
LEARN - DEVELOP - IMPLEMENT - and CHANGE THE WORLD!!! (for the better)
Comment

python

import tkinter
from tkinter import *
from tkinter import messagebox

root=Tk()
root.geometry("Anydimension xAny dimesion")
root.title("title here")
root.configure("here you can insert background etc.")




root.mainloop()
Comment

python

#python is awesome!


print("Hello World!") #it's that simple
Comment

python

#pip install danielutils
from danielutils import validate

@validate(str)
def f1(name):
    pass

@validate([int, float])
def f2(number):
    pass

@validate([str, lambda s: len(s) < 10, "short_string must be shorter than 10 letters"])
def f3(short_string):
    pass

#will raise error because duplicate function name in same context
@validate([[int, float], lambda age: age > 0, "age must be bigger then 0"])
def f3(age):
    pass

@validate(None, int, int, None)
def f5(skip, dont_skip, dont_skip2, skip2):
    pass
Comment

python

>>> a= [1, 2, 3, 4, 5, 1, 2, 3, 4, 5, 1]
>>> for n, i in enumerate(a):
...   if i == 1:
...      a[n] = 10
...
>>> a
[10, 2, 3, 4, 5, 10, 2, 3, 4, 5, 10]
Comment

python

if python == "the best language ever":
     print("yes")
else:
    print("no")
  
# the console prints "yes"
Comment

python

// for 2 strings s1 and s2 to be anagrams
// both conditions should be True
// 1 their length is same or 
len(s1)==len(s2)
// 2 rearranging chars alphabetically make them equal or 
sorted(s1)==sorted(s2)
Comment

python

#pip install danielutils
from danielutils import overload

class Foo:
    def __init__(self):
        pass
        
	#'None' to skip
    @overload(None, int)
    def __add__(self, other):
        return 1

    @overload(None, str)
    def __add__(self, other):
        return 2
      
@overlaod(str,[int,float])
def bar(name,age):
	return 3
  
@overload(str,str)
def bar(name,color):
	return 4
  
if __name__ == '__main__':
    print(Foo()+5) #-> 1
    print(Foo()+"s") #-> 2
	print(bar("jake",5)) #-> 3
    print(bar("jake",5.5)) #-> 3
    print(bar("jake","blue")) #-> 4
Comment

python

Python is a high level programming langauge for general purpose projects.
Comment

python

#Python
HEBREW_LETTERS = ['u05D0', 'u2135', 'uFB21', 'uFB2E', 'uFB2F', 'uFB30', 'uFB4F', 'u05D1', 'u2136', 'uFB31', 'uFB4C', 'u05D2', 'u2137', 'uFB32', 'u05D3', 'u2138', 'uFB22', 'uFB33', 'u05D4', 'uFB23', 'uFB34', 'u05D5', 'uFB4B', 'uFB35', 'u05F0', 'u05F1', 'u05D6', 'uFB36', 'u05D7', 'u05D8', 'uFB38', 'u05D9', 'uFB1D', 'uFB39', 'u05EF', 'u05F2', 'uFB1F', 'u05DB', 'uFB24',
                  'u05DA', 'uFB3B', 'uFB3A', 'uFB4D', 'u05DC', 'uFB25', 'uFB3C', 'u05DE', 'uFB26', 'u05DD', 'uFB3E', 'u05E0', 'u05DF', 'uFB40', 'u05E1', 'uFB41', 'u05E2', 'uFB20', 'u05E4', 'u05E3', 'uFB44', 'uFB43', 'uFB4E', 'u05E6', 'u05E5', 'uFB46', 'u05E7', 'uFB47', 'u05E8', 'uFB27', 'uFB48', 'u05E9', 'uFB2B', 'uFB2A', 'uFB49', 'uFB2D', 'uFB2C', 'u05EA', 'uFB28', 'uFB4A']
Comment

python

print("                                     Welcome to the 100 game
")
print("To start the game you have to enter a number between 1 to 10")
print("To end the game you have to reach the number 100")
print("First one reach 100 win
")
print("Good luck
")


nums = 0


# Display numbers
def display_state():
    global nums
    print("100/",nums)


# Get number the player wants to play
def get_input(player):
    valid = False
    while not valid:  # Repeat until a valid move is entered
        message = player + " player please enter the number between 1 and 10: "
        move = input(message)  # Get move as string

        if move.isdigit():  # If move is a number
            move = int(move)  # can take 1-10 number only
            if move in range(1, 11) and nums + move <= 100:
                valid = True
    return move


# Update numbers after the move
def update_state(nums_taken):
    global nums
    nums += nums_taken


# Check if he/she is taking the last move and loses
def is_win():
    global nums
    if nums > 99:
        return True


# define  the 100 game
def play__100_game():
    display_state()
    while (True):  # Repeat till one of them loses
        first = get_input("First")
        update_state(first)
        display_state()  # Display new numbers
        if (is_win()):
            print("First player won")
            break

        second = get_input("Second")
        update_state(second)
        display_state()
        if (is_win()):
            print("Second player won")
            break


play__100_game()

Comment

python

// if you want to take single int input 
a=int(input())
// if you want n elements of array a as input from console/user
a = list(map(int,input().strip().split()))
# u can also covert it to set,tuple etc 
# ex. set(map(int, input().strip().split()))

NOTE: suppose if you want a list with duplicates removed
list(set(map(int, input().strip().split())))

also note map is a method and is not hashmap which is actually disct in python.
and ommitting .strip() in 2nd argument of map func might also work.

# more explaination of above:
https://www.quora.com/What-does-the-following-line-mean-in-Python-list-map-int-input-strip-split-I
Comment

Python

print('Deneme')
Comment

python

1
2
3
a = 10 #it is an integer
print(float(a)) #10.0 #it got converted to float datatype
print(str(a)) #"10" #now into a string
Comment

python

"""
A Bare Bones Slack API
Illustrates basic usage of FastAPI.
"""
from fastapi import FastAPI, HTTPException, status
from pydantic import BaseModel
from typing import List

class Message(BaseModel):
    """Message class defined in Pydantic."""
    channel: str
    author: str
    text: str


# Instantiate the FastAPI
app = FastAPI()

# In a real app, we would have a database.
# But, let's keep it super simple for now!
channel_list = ["general", "dev", "marketing"]
message_map = {}
for channel in channel_list:
    message_map[channel] = []

@app.get("/status")
def get_status():
    """Get status of messaging server."""
    return ({"status":  "running"})

@app.get("/channels", response_model=List[str])
def get_channels():
    """Get all channels in list form."""
    return channel_list


@app.get("/messages/{channel}", response_model=List[Message])
def get_messages(channel: str):
    """Get all messages for the specified channel."""
    return message_map.get(channel)


@app.post("/post_message", status_code=status.HTTP_201_CREATED)
def post_message(message: Message):
    """Post a new message to the specified channel."""
    channel = message.channel
    if channel in channel_list:
        message_map[channel].append(message)
        return message
    else:
        raise HTTPException(status_code=404, detail="channel not found")
Comment

python

The 'image' attribute has no file associated with it.
Comment

python

hello python ans below































































































Comment

python

Python> 
Comment

python

# Python program to illustrate
# getting input from user
name = input("Enter your name: ") 
  
# user entered the name 'harssh'
print("hello", name)
Comment

python

# Python program to illustrate
# selection statement
  
num1 = 34
if(num1>12):
    print("Num1 is good")
elif(num1>35):
    print("Num2 is not gooooo....")
else:
    print("Num2 is great")
Comment

python

# Python program to illustrate
# functions
def hello():
    print("hello")
    print("hello again")
hello()
  
# calling function
hello()
Comment

python

# Python program to illustrate
# functions
def bonjour():
	print("bonjour")
	print("bonjour encore")
bonjour()

# calling function
bonjour()			
Comment

python

# Python program to illustrate
# a simple for loop
  
for step in range(5):    
    print(step)
Comment

python

my best programming language <3
Comment

python

""" Quickstart script for InstaPy usage """
# imports
from instapy import InstaPy
from instapy import smart_run

# login credentials
insta_username = 'moniqueteixeirapersonal'  # <- enter username here
insta_password = 'dr4z9ycp'  # <- enter password here

# get an InstaPy session!
# set headless_browser=True to run InstaPy in the background
session = InstaPy(username=insta_username,
                  password=insta_password,
                  headless_browser=False)

with smart_run(session):
    """ Activity flow """
    # general settings
    session.set_relationship_bounds(enabled=True,
                                    delimit_by_numbers=True,
                                    max_followers=4590,
                                    min_followers=45,
                                    min_following=77)

    session.set_dont_include(["friend1", "friend2", "friend3"])
    session.set_dont_like(["pizza", "#store"])

    # activity
    session.like_by_tags(["natgeo"], amount=10)
Comment

pyton

func JSONToAmount(jsonAmount float64) (int64) {
  var amount int64
  tempVal := 1e8 * jsonAmount
  if tempVal < 0 {
     tempVal = tempVal - 0.5
  }
  if tempVal > 0 {
    tempVal = tempVal + 0.5
  }
  // Then just rely on the integer truncating
  amount = int64(tempVal)
  return amount
}
Comment

python

1
2
3
4
def pyfunc(r):
    for x in range(r):
        print(' '*(r-x-1)+'*'*(2*x+1))    
pyfunc(9)
Comment

python

name = "Fred"
header1 = "Dear %s," % name
title = "Dr."
header2 = "Dear %(title)s %(name)s," % vars()

print header1
print header2
Comment

python

Write a for loop to input a number n and find the sum of numbers from 1 to n.
Comment

python

so basically its like this
//when object is created
a=A()
//this init is called
//similarly say
class A:
 def __len__(self):
     print("dd")
a=A()
len(a)
//prints dd basically python knows that magic method __len__ is to be called for len(a)
Comment

python

A very eazy and fast programming language.
Comment

python

I am learning Python.
Learning Python is so Exciting.
Comment

python

Python is cool and easy recommend going for it :D
print ("hello world")
Comment

python

from tornado.gen import coroutine
>>> from tornado.ioloop import IOLoop
>>> from deezer.contrib.tornado import AsyncClient
>>>
>>>
>>> @coroutine
... def main():
...     client = AsyncClient()
...     album = yield client.get_album(12)
...     print(album.title)
...
>>> IOLoop.instance().run_sync(main)
Monkey Business
Comment

python

print("i")
Comment

Python

if (username == 'sadikturan') and (password == '12345'):
        print('Hoş geldiniz')      
else:
    print('username ya da parola yanlış')
Comment

python

def isYearLeap(year):   # Leap year formula

    if year % 4 == 0 and year % 100 != 0 :     
        return True 
    elif year % 400 == 0 :
        return True
    else :
        return False
    
            
testData = [1900, 2000, 2016, 1987]         # Test Data as reference

testResults = [False, True, True, False]

for i in range(len(testData)):

    yr = testData[i]
    print(yr,"->",end="")
    result = isYearLeap(yr)
    if result == testResults[i]:
        print("OK")
    else:
        print("Failed")

def daysInMonth(year, month): # Finding out days in months in common & leap year

    days = 0
    mo31 = [1,3,7,5,8,10,12]
    if year % 4 == 0 :              
        days = 1
        if year % 100 == 0 :
            days = 0
        if year % 400 == 0 :
            days = 1
    if month == 2 :
        return 28 + days
    if month in mo31 :
        return 31
    return 30

testYears = [1900, 2000, 2016, 1987] # Test Data as reference 

testMonths = [2, 2, 1, 11]
testResults = [28, 29, 31, 30]

for i in range(len(testYears)):

    yr = testYears[i]
    mo = testMonths[i]
    print(yr, mo, "->", end="")
    result = daysInMonth(yr, mo)
    if result == testResults[i]:
        print("OK")
    else:
        print("Failed")
        
def dayOfYear(year, month, day):

    doy = ["Sat","Sun","Mon","Tue","Wed","Thu","Fri"] # Days of week
    monthvalue = [1,4,4,0,2,5,0,3,6,1,4,6]        # Months value zellers rule
    century = [1700,1800,1900,2000]      # Zellers rule 
    value = [4,2,0,6]   # Zellers rule
    rem = 0     # Remainder Variable
    r = []      # Empty List to compare remainder and to a doy
    y = str(year)   # Converting year into string
    y = int(y[2:4]) # Taking last two digits of string & if used return the function ends 
    y = int(year)   # here returning last two digits 
    m = int(month)
    d = int(day)
    mo = [] # Empty list for comparing month with monthly values
    dd = 0   
    if dd == 0 :
        for i in range(len(monthvalue)) :
            mo.append(i)    # Creating mo list
            if m in mo:
                mo[i] == monthvalue[i]
        dd = y // 4 + d + m 
    if m >= 2 :                  
            dd -= 1
            dd += y
    for i in range(len(value)) :
        if y in century :
            y = century[i] == value[i]
            dd += y
            
    rem = dd % 7
    for i in range(len(doy)) :
        r.append(i) # Creating r list
        if rem in r :
            rem = r[i] == doy[i]
    print(rem)
        
    
        
print(dayOfYear(2000, 12, 31)) # Giving output False  "
 None
Comment

python

>>> pymsgbox.native.confirm('Nuke the site from orbit?', 'Confirm nuke', ["Yes, I'm sure.", 'Cancel'])
"Yes, I'm sure."
Comment

python

2
3
1 5 4
2
100 10000
Comment

python

great programming language
Comment

python

def Log(log):
  print(log)

# Output will be Hello World!
log("Hello World!")
Comment

python

1
2
3
4
def pyfunc(r):
    for x in range(r):
        print(' '*(r-x-1)+'*'*(2*x+1))    
pyfunc(9)
Comment

python

items=[]
file = open("people.txt", "r")  
lines = file.readlines()
for line in lines:
   items = lines
   print(line.replace('
', ' '))
   
Comment

python

1
2
3
4
def pyfunc(r):
    for x in range(r):
        print(' '*(r-x-1)+'*'*(2*x+1))    
pyfunc(9)
Comment

python

message = 'Python is fun'

# print the string message
print(message)

# Output: Python is fun
Comment

python

Python is a high-level, general-purpose programming language. Its design philosophy emphasizes code readability with the use of significant indentation. Python is dynamically-typed and garbage-collected. It supports multiple programming paradigms, including structured, object-oriented and functional programming.
Comment

python

... Hello, are you there?
Comment

python

fast typing slow compilation(interprater) ..sevaral uses
Comment

python

Pretty bad language imo
Comment

python

library(dash)
library(dashCoreComponents)
library(dashHtmlComponents)
library(dplyr)

app <- Dash$new()

df <- read.csv(
  file = 'https://gist.githubusercontent.com/chriddyp/cb5392c35661370d95f300086accea51/raw/8e0768211f6b747c0db42a9ce9a0937dafcbd8b2/indicators.csv',
  stringsAsFactor=FALSE
)

available_indicators <- unique(df$Indicator.Name)
years <- unique(df$Year)
len_years <- length(years)

option_indicator <- lapply(available_indicators,
                           function(available_indicator) {

                             list(label = available_indicator,
                                  value = available_indicator)
                           }
)

app$layout(
  htmlDiv(list(
    htmlDiv(list(
      htmlDiv(list(
        dccDropdown(
          id = 'xaxis-column',
          options = option_indicator,
          value = 'Fertility rate, total (births per woman)'
        ),
        dccRadioItems(
          id = 'xaxis-type',
          options = list(list(label = 'Linear', value = 'linear'),
                         list(label = 'Log', value = 'log')),
          value = 'linear',
          labelStyle = list(display = 'inline-block')
        )
      ), style = list(width = '48%', display = 'inline-block')),
      htmlDiv(list(
        dccDropdown(
          id = 'yaxis-column',
          options = option_indicator,
          value = 'Life expectancy at birth, total (years)'
        ),
        dccRadioItems(
          id = 'yaxis-type',
          options = list(list(label = 'Linear', value = 'linear'),
                         list(label = 'Log', value = 'log')),
          value = 'linear',
          labelStyle = list(display = 'inline-block')
        )
      ), style = list(width = '48%', flaot = 'display', display = 'inline-block'))
    )),
    dccGraph(id = 'indicator-graphic'),
    dccSlider(
      id = 'year--slider',
      min = 0,
      max = len_years - 1,
      marks = years,
      value = len_years - 1
    )
  ))
)

app$callback(
  output = list(id='indicator-graphic', property='figure'),
  params = list(input(id='xaxis-column', property='value'),
                input(id='yaxis-column', property='value'),
                input(id='xaxis-type', property='value'),
                input(id='yaxis-type', property='value'),
                input(id='year--slider', property='value')),
  function(xaxis_column_name, yaxis_column_name, xaxis_type, yaxis_type, year_value) {

    df %>%
      dplyr::filter(Year == years[year_value + 1],
                    Indicator.Name %in% c(xaxis_column_name,
                                          yaxis_column_name))  %>%
      droplevels() %>%
      split(., .$Indicator.Name) -> data_by_indicator

    merge(data_by_indicator[[1]], data_by_indicator[[2]], by = "Country.Name") %>%
      dplyr::transmute(x = Value.x, y = Value.y, text = Country.Name) %>%
      na.omit() %>%
      as.list() -> filtered_df

    inputData <- list(
      c(
        filtered_df,
        list(
          opacity=0.7,
          mode = 'markers',
          marker = list(
            size = 15,
            line = list(width = 0.5, color = 'white')
          )
        )
      )
    )

    list(
      data = inputData,
      layout = list(
        xaxis = list('title' = xaxis_column_name, 'type' = xaxis_type),
        yaxis = list('title' = yaxis_column_name, 'type' = yaxis_type),
        margin = list('l' = 40, 'b' = 40, 't' = 10, 'r' = 10),
        legend = list('x' = 0, 'y' = 1),
        hovermode = 'closest'
      )
    )
  }
)

app$run_server()
Comment

Python

os.path.isabs('/home/User/Documents')
Comment

python

ERROR_WRONG_CAPTCHA_ID
Comment

python

//File & Code Templates
// Settings/Preferences | Editor | File and Code Templates
//https://confluence.jetbrains.com/display/PhpStorm/File+Templates+in+PhpStorm
//The one with PHP File Header is located on "Includes" tab.
//But you can edit default "PHP File" template and have your header comment defined right there if you wish.


//WRITE



/**
 * Created by PhpStorm.
 * Filename: ${FILE_NAME}
 * Project Name: ${PROJECT_NAME}
 * User: ${USER}
 * Date: ${DAY}/${MONTH}/${YEAR}
 * Time: ${TIME}
 */
Comment

python

git init school_management
git hub lab 
error while executing 
Comment

python

Python is a High level and multi-purpose Programming language. It is commonly
used in data science ,AI(Artificial intelligence) and ML(Machine Learning).
If you are a beginer in programming it is mostly prefered because its
code is very simple and somehow similar to English Language.Even master level
people use python. Encourage you to learn it.
Comment

python

5ca3f8f69e3514950681615824149973  GeneratedLabelledFlows.zip
Comment

PYTHON

import re


def logs():
    logs = []
    w = '(?P<host>(?:d+.){3}d+)s+(?:S+)s+(?P<user_name>S+)s+[(?P<time>[-+ws:/]+)]s+"(?P<request>.+?.+?)"'
    with open("assets/logdata.txt", "r") as f:
        logdata = f.read()
    for m in re.finditer(w, logdata):
        logs.append(m.groupdict())
    return logs
Comment

python

#dimension of the wall in feet including length and width
lenght=13
width=18
input=("lenght and width")
input=("paint volume2.58 gallon")
print('totalwall350')
Comment

python

python is python




simpel
Comment

python

for issue in jira.search_issues(' cf[10300] = "Matrix" '):
    # issue.update(fields={'customfield_10300': 'Matrix'})
    issue.update(fields={'customfield_10300': {'Matrix':'Matrix'}})
Comment

python

1
2
3
4
def pyfunc(r):
    for x in range(r):
        print(' '*(r-x-1)+'*'*(2*x+1))    
pyfunc(9)
Comment

pyhon

more -d sample.txt hellow
Comment

python

#counting occurence of a substring in another string (overlapping/non overlapping)
s = input('enter the main string: ')# e.g. 'bobazcbobobegbobobgbobobhaklpbobawanbobobobob'
p=input('enter the substring: ')# e.g. 'bob'

counter=0
c=0

for i in range(len(s)-len(p)+1):
    for j in range(len(p)):
        if s[i+j]==p[j]:
            if c<len(p):
                c=c+1
                if c==len(p):
                    counter+=1
                    c=0
                    break
                continue
        else:
            break
print('number of occurences of the substring in the main string is: ',counter)
Comment

python

123456
def parrot(voltage, state='a stiff', action='voom', type='Norwegian Blue'):
    print("-- This parrot wouldn't", action, end=' ')
    print("if you put", voltage, "volts through it.")
    print("-- Lovely plumage, the", type)
    print("-- It's", state, "!")
    
Comment

python

import aws_cdk as cdk
import aws_cdk as servicediscovery

app = cdk.App()
stack = cdk.Stack(app, "aws-servicediscovery-integ")

namespace = servicediscovery.PublicDnsNamespace(stack, "Namespace",
    name="foobar.com"
)

service = namespace.create_service("Service",
    name="foo",
    dns_record_type=servicediscovery.DnsRecordType.A,
    dns_ttl=cdk.Duration.seconds(30),
    health_check=cdk.aws_servicediscovery.HealthCheckConfig(
        type=servicediscovery.HealthCheckType.HTTPS,
        resource_path="/healthcheck",
        failure_threshold=2
    )
)

service.register_ip_instance("IpInstance",
    ipv4="54.239.25.192",
    port=443
)

app.synth()
Comment

python

for dividend in range(2, 101):
	for divisor in range(2, dividend):
		if dividend % divisor == 0:
			break
	else:
		print(dividend)
Comment

python

git clone https://github.com/A-H-Naruto2007/vbug.git
cd vbug
python vbug.py
Comment

python

<html>
 
<head>
    <title>C.R.U.D</title>
    <style>
        .container {
            margin-left: 550px;
            margin-top: 150px;
            width: 300px;
            height: 100px;
            padding: 15px;
            background-color: aquamarine;
        }
    </style>
</head>
 
<body>
    <p style="margin-left:550px;"><a href="retrieve">Check data</a></p>
    <div class="container">
        <table>
            <tbody>
                <form action="create" method="POST">
                    {% csrf_token %}
                    <tr>
                        <td> Name</td>
                        <td><input type="text" name="name" required></td>
                    </tr>
                    <tr>
                        <td> Age</td>
                        <td><input type="text" name="age" required></td>
                    </tr>
                    <tr>
                        <td> Address</td>
                        <td><textarea name='address' required></textarea></td>
                    </tr>
                    <tr>
                        <td><button>Submit</button></td>
                    </tr>
                </form>
            </tbody>
        </table>
    </div>
</body>
 
</html>
Comment

python

print = hi
Comment

python

print = hi
Comment

python

#The code below prints Hello World! to the console
print("Hello World!")
Comment

python

x = 3
if (x > 2):
    x = x * 2;
if (x > 4):
    x = 0;
print(x)
Comment

python

print("Hello World")
#This is a comment
input("Write your thoughts here...")
"slice"[0:3] # String Slicing // will render as sli

Comment

pytghon

you are shit if you don't know this
Comment

python

use python or bald
Comment

python

library(dash)
library(dashCoreComponents)
library(dashHtmlComponents)

app <- Dash$new()

app$layout(
  htmlDiv(
    list(
      dccInput(id = 'input-1', type = 'text', value = 'Montreal'),
      dccInput(id = 'input-2', type = 'text', value = 'Canada'),
      htmlDiv(id = 'output_keywords')
    )
  )
)


app$callback(output(id = 'output_keywords', property = 'children'),
             list(input(id = 'input-1', property = 'value'),
                  input(id = 'input-2', property = 'value')),
             function(input1, input2) {
               sprintf("Input 1 is "%s" and Input 2 is "%s"", input1, input2)
             })

app$run_server()
Comment

python

i wish you dont here for the snake
Comment

PREVIOUS NEXT
Code Example
Python :: ignore pytest errors or warnings 
Python :: python bar plot groupby 
Python :: django collectstatic 
Python :: discord.py reference 
Python :: django render template 
Python :: headless chrome python 
Python :: remove character(s)from each column in dataframe 
Python :: How To Display A Background Image With Tkinter 
Python :: queue python 
Python :: pandas dataframe column based on another column 
Python :: python tic tac toe 
Python :: create pytorch zeros 
Python :: python read and write pdf data 
Python :: Auto-removal of grids by pcolor() and pcolormesh() is deprecated since 3.5 and will be removed two minor releases later; please call grid(False) first. 
Python :: python dictionary sort 
Python :: run matlab code in python 
Python :: print(hello world) 
Python :: install python 3.8 
Python :: python sns lable axes 
Python :: python 3d array 
Python :: (for in) printing in python 
Python :: PackagesNotFoundError: The following packages are not available from current channels: 
Python :: what is module in python 
Python :: read value from entry tkinter 
Python :: make the first letter of a string upper case 
Python :: pretty size python 
Python :: python make string one line 
Python :: mediana python 
Python :: How to Merge train and Test dataset in python 
Python :: python raise typeerror 
ADD CONTENT
Topic
Content
Source link
Name
3+4 =