Forwarded from Python Questions
https://t.me/python_interview_questions/117
Only 14% got this correct.
Only 14% got this correct.
None of the above
True, False and None are capitalized, that is the first letter in these keywords start with a Capital letter.
The rest of all the other keywords are in lower case.
Hence, the correct answer is "
".
Telegram
Python Questions
All keywords in Python are in?
lower case / UPPER CASE / snake_case / camel_case / Capitalized / None of the above / Show me the answer
lower case / UPPER CASE / snake_case / camel_case / Capitalized / None of the above / Show me the answer
Forwarded from Python Projects
#PracticeCode: 0047
🎯 FORWARD IF YOU LIKE IT 🎯
Task:
You have to create a program to join multiple dictionaries to a new dictionary.
Sample :-
d1 = { "a" : 23 , "b" : 45 }
d2 = { "c" : 54 , "d" : 67 }
output - new_dict = { "a" : 23 , "b" : 45 , "c" : 54 , "d" : 67 }
GOOD LUCK!
««« Discuss your solution @python_programmers_club and proper solutions will be added to our Github page »»»
««« Click here for the Solution »»»
🔥Ready to take this challenge? 🔥
#python #PracticeCode #samples #interviewQuestions #conditions #dict
🎯 FORWARD IF YOU LIKE IT 🎯
Task:
You have to create a program to join multiple dictionaries to a new dictionary.
Sample :-
d1 = { "a" : 23 , "b" : 45 }
d2 = { "c" : 54 , "d" : 67 }
output - new_dict = { "a" : 23 , "b" : 45 , "c" : 54 , "d" : 67 }
GOOD LUCK!
««« Discuss your solution @python_programmers_club and proper solutions will be added to our Github page »»»
««« Click here for the Solution »»»
🔥Ready to take this challenge? 🔥
#python #PracticeCode #samples #interviewQuestions #conditions #dict
Forwarded from Python Questions
print("abbcabcacabb".count('abb', 2, 11))
#What is the output of the above statement? Explain this statement?
#What is the output of the above statement? Explain this statement?
Anonymous Quiz
27%
2
23%
1
14%
0
21%
Error
14%
Show me the answer
Forwarded from Python Projects
#PracticeCode: 0048
🎯 FORWARD IF YOU LIKE IT 🎯
Task:
You have to create a program to create a dictionary. Take input of an integer (from 1 to n) and print the dictionary in (a , a**2) format.
Sample :-
Input - 4
Output - { 1 : 1 , 2 : 4 , 3 : 9 , 4 : 16}
GOOD LUCK!
««« Discuss your solution @python_programmers_club and proper solutions will be added to our Github page »»»
««« Click here for the Solution »»»
🔥Ready to take this challenge? 🔥
#python #PracticeCode #samples #interviewQuestions #conditions #dict
🎯 FORWARD IF YOU LIKE IT 🎯
Task:
You have to create a program to create a dictionary. Take input of an integer (from 1 to n) and print the dictionary in (a , a**2) format.
Sample :-
Input - 4
Output - { 1 : 1 , 2 : 4 , 3 : 9 , 4 : 16}
GOOD LUCK!
««« Discuss your solution @python_programmers_club and proper solutions will be added to our Github page »»»
««« Click here for the Solution »»»
🔥Ready to take this challenge? 🔥
#python #PracticeCode #samples #interviewQuestions #conditions #dict
Forwarded from Python Questions
x = “python”+1+2+3
# What is the value of x? Explain?
# What is the value of x? Explain?
Anonymous Quiz
27%
python123
11%
"python",1,2,3
21%
python6
34%
Error
3%
None of the above
4%
Show me the answer
Forwarded from Python Questions
Forwarded from Python Questions
Forwarded from Python Questions
The bare minimum: Django in less than 50 lines of code
https://redd.it/fje66v
#!/usr/bin/env python
import sys
from django.conf import settings
"""
Usage:
1. download this file tinydjango.py
2. run `pip install django`
3. run `python tinydjango.py runserver 8000`
4. open a browser and head to http://localhost:8000
5. bananas
"""
DEBUG = False
SECRET_KEY = '41+_$!j&y@zr#9cxdp6m9o3j&6dnk__bq*deii)5w6w744e7a#'
ALLOWED_HOSTS = ['localhost', '127.0.0.1', '[::1]']
settings.configure(
DEBUG=DEBUG,
SECRET_KEY=SECRET_KEY,
ALLOWED_HOSTS=ALLOWED_HOSTS,
ROOT_URLCONF=__name__,
MIDDLEWARE_CLASSES=(
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
),
)
from django.conf.urls import url
from django.core.wsgi import get_wsgi_application
from django.http import HttpResponse
def index(request):
return HttpResponse('<html><head></head><body><h1>Hello World</h1></body></html>')
urlpatterns = (
url(r'^$', index),
)
application = get_wsgi_application()
if __name__ == "__main__":
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
https://redd.it/fje66v
reddit
The bare minimum: Django in less than 50 lines of code
#!/usr/bin/env python import sys from django.conf import settings """ Usage: 1. download this file tinydjango.py ...
Forwarded from Python Questions
# Python Code to copy to Windows Clipboard
Code#python #CodeSamples
import win32clipboard
# set clipboard data
win32clipboard.OpenClipboard()
win32clipboard.EmptyClipboard()
win32clipboard.SetClipboardText('testing 123')
win32clipboard.CloseClipboard()
# get clipboard data
win32clipboard.OpenClipboard()
data = win32clipboard.GetClipboardData()
win32clipboard.CloseClipboard()
print data
Forwarded from Python Questions
print('KLM'.maketrans('KLM', '123'))
What is the output? Explain the function maketrans()
What is the output? Explain the function maketrans()
Anonymous Quiz
11%
{65: 49, 66: 50, 67: 51}
26%
{75: 49, 76: 50, 77: 51}
14%
{75: 49, 66: 50, 77: 51}
17%
None of the above
31%
Show me the answer
Check if the file is empty or not
#python #CodeSamples
import os
file_path = 'mysample.txt'
# check if size of file is 0
if os.stat(file_path).st_size == 0:
print('File is empty')
else:
print('File is not empty')
#python #CodeSamples
Forwarded from Python Questions
print('iGnani'.translate({'i': '1', 'G': '2', 'n': '3', 'a': '4', 'i': '5'}))
#What is the output. Explain translate()
#What is the output. Explain translate()
Anonymous Quiz
39%
123435
20%
12345
16%
iGnani
9%
Error
5%
None of the above
12%
Show me the answer
The while Loop
#python #CodeSamples
while <expr>:
<statement(s)>
<break> #will take you out of the loop
<statements>
<continue>
<statements>
<statements> #break will bring you here
Example:
x = 10
while x > 0:
x -= 1
if x == 5:
break
if x == 8:
continue #Don't print when its 8
print(x)
print("outside loop")
#python #CodeSamples
Forwarded from Python Questions
Class accepting List as argument in init()
#python #CodeSamples
class myclass:
def __init__(self, mylst = []):
print(mylst)
names = ["hello", "python", "devs", "iGnani"]
myclass(names)
#python #CodeSamples
machine-learning-cheat-sheet.pdf
1.9 MB
Machine Learning Cheat Sheet
Classical equations, diagrams and tricks in machine learning
#eBook #ML #machineLearning #DataScience #AI #DataMining #DeepLearning #Algorithms #AppliedMathematics
Classical equations, diagrams and tricks in machine learning
This cheat sheet is a condensed version of machine learning manual, which contains many classical equations and
diagrams on machine learning, and aims to help you quickly recall knowledge and ideas in machine learning.
#eBook #ML #machineLearning #DataScience #AI #DataMining #DeepLearning #Algorithms #AppliedMathematics
Pandas SQL Example - Reproducing SQL Queries In Python
https://youtu.be/m1jHkL0qZsI
In this video on reproducing SQL queries in Python using Pandas library, I am going to show you Pandas SQL examples on how to write pandas code reproducing sql statements.
Using pandas, i will show you how to get sql results in python like
* grouping and aggregation on multiple columns in pandas, similar to sql groupby clause
* sorting by multiple columns, reproducing sql order by clause
* filter multiple conditions, which involves where conditions with multiple columns
and a lot more...
https://youtu.be/m1jHkL0qZsI
YouTube
Pandas SQL Example - Reproducing SQL Queries In Python
In this video on reproducing SQL queries in Python using Pandas library, I am going to show you Pandas SQL Example on how to write pandas sql statements.
Using pandas, i will show you how to get sql results in python like
* pandas grouping and aggregation…
Using pandas, i will show you how to get sql results in python like
* pandas grouping and aggregation…