Python programming codes
43 subscribers
25 photos
1 video
83 files
82 links
Uploading All programming codes are updating Daily
ask doubts in comment box πŸŽβ˜‘οΈ
Download Telegram
For which type of error does the interpreter runs the program but halts at error and reports the error as an "Exception"?
Anonymous Quiz
0%
semantic error
33%
syntax error
33%
all type of errors
33%
runtime error
For which type of error does the interpreter runs the program and does not report an error?
Anonymous Quiz
33%
syntax error
0%
semantic error
67%
runtime error
0%
all type of errors
What do you type to enter the interactive help mode of Python?
Anonymous Quiz
25%
HELP
0%
help
75%
help()
0%
save
In IDLE shell, what is the keyboard shortcut for the previous command in history on Windows/Linux?
Anonymous Quiz
50%
Ctrl + P
0%
Alt + P
25%
Page Up
25%
Page Down
In IDLE shell, what is the keyboard shortcut for the next command in history on Windows/Linux?
Anonymous Quiz
50%
Alt + N
50%
Ctrl + N
0%
Page Up
0%
Page Down
what is the output of the python code?

list = ["xyz","zara","pynative"]
print(max(list))
def x(values):
values[0] = 1
v = [2,3,4] x(v) print(x)
Anonymous Quiz
25%
[1,2,3]
0%
[2,3,4]
25%
Error
50%
None
#Display the calendar by using the python code

import calendar #first import the calendar library module
from datetime import*
#year = 2023 #mention the past or present or future years

year = date.today().year
month = 1 #mention the 1 to 12 month numbers βˆ†βˆ† starting with no zero (0) mention ortherwise the program error display

#then after the print operation to display the output
print(calendar.month(year,month))

print("today date is",date.today().day)
output color Changing in python interpreter

from colorama import Fore

print(Fore.RED + "smw_media")

print(Fore.YELLOW + "smw_media")

print(Fore.BLUE + "smw_media")

print(Fore.GREEN + "smw_media")

print(Fore.CYAN + "smw_media")
πŸ‘1
#print the current date and time
import datetime

now = datetime.datetime.now()

print("Current date and time")

print(now.strftime("%Yyear%mmonth%dday%Hhours%Mminutes%Sseconds"))
Here is the HTML code for an "Add to Cart" button that you can use in your website or project:


<div class="container">
<button class="add-to-cart-button">
<svg
class="add-to-cart-box box-1"
width="24"
height="24"
viewBox="0 0 24 24"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<rect width="24" height="24" rx="2" fill="#ffffff" />
</svg>
<svg
class="add-to-cart-box box-2"
width="24"
height="24"
viewBox="0 0 24 24"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<rect width="24" height="24" rx="2" fill="#ffffff" />
</svg>
<svg
class="cart-icon"
xmlns="http://www.w3.org/2000/svg"
width="24"
height="24"
viewBox="0 0 24 24"
fill="none"
stroke="#ffffff"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
>
<circle cx="9" cy="21" r="1"></circle>
<circle cx="20" cy="21" r="1"></circle>
<path
d="M1 1h4l2.68 13.39a2 2 0 0 0 2 1.61h9.72a2 2 0 0 0 2-1.61L23 6H6"
></path>
</svg>
<svg
class="tick"
xmlns="http://www.w3.org/2000/svg"
width="24"
height="24"
viewBox="0 0 24 24"
>
<path fill="none" d="M0 0h24v24H0V0z" />
<path
fill="#ffffff"
d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zM9.29 16.29L5.7 12.7c-.39-.39-.39-1.02 0-1.41.39-.39 1.02-.39 1.41 0L10 14.17l6.88-6.88c.39-.39 1.02-.39 1.41 0 .39.39.39 1.02 0 1.41l-7.59 7.59c-.38.39-1.02.39-1.41 0z"
/>
</svg>
<span class="add-to-cart">Add to cart</span>
<span class="added-to-cart">Added to cart</span>
</button>
</div>
Here is the Javascript code for an "Add to Cart" button that you can use in your website or project:





To create a pop-up display that shows "added to cart" when a user clicks the "Add to Cart" button, we need to add some JavaScript code. We can use the setTimeout() function to delay the execution of our code for a certain period of time after the user clicks the button.




addToCartButton = document.querySelectorAll(".add-to-cart-button");
document.querySelectorAll('.add-to-cart-button').forEach(function(addToCartButton) {
addToCartButton.addEventListener('click', function() {
addToCartButton.classList.add('added');
setTimeout(function(){
addToCartButton.classList.remove('added');
}, 2000);
});
});
Output of an "Add to Cart" Button:
πŸš€Top 12 websites for remote work opportunities

⚑️ Pangian - https://pangian.com
⚑️ WeWorkRemotely - https://lnkd.in/gU4Ux_xW
⚑️ ARC - https://arc.dev
⚑️RemoteLeaf - https://remoteleaf.com/
⚑️ ZipRecuriter -https://lnkd.in/dYpCQU8P
⚑️ Indeed - https://in.indeed.com/m/
⚑️ Remotive - https://remotive.com
⚑️ JustRemote - https://justremote.co/
⚑️ AngelList - https://angel.co/
⚑️ Jobspresso - https://jobspresso.co/
⚑️ DailyRemote - https://dailyremote.com
⚑️ Working Nomads - https://lnkd.in/geSbdqVG


πŸš€Top 10 websites for freelance/part-time jobs ⏳


⚑️ Freelance - https://www.freelance.com
⚑️ Guru - https://www.guru.com/
⚑️ Upwork - https://www.upwork.com/
⚑️ LinkedIn - http://www.linkedin.com/
⚑️ Snagajob - https://www.snagajob.com/
⚑️ LinkedIn - http://www.linkedin.com/
⚑️ Solid Gigs - https://solidgigs.com
⚑️ ServiceScape - https://lnkd.in/guR5EV_z
⚑️ Craigslist - http://www.craigslist.org/
⚑️ CoolWorks - https://www.coolworks.co
⚑️ Fiverr - https://www.fiverr.com/
⚑️ Contena - https://www.contena.co
def rec(a, b):
if a == 0:
return b
else:
return rec(a - 1, a + b)

print (rec (8, 12))

what's the output of above python code?
a)12
b)36
c)16
d)48
comment ur answer
a=0
b=1
print(a or b)
what's the output of above python code?
a)1
b)0
c)0 or 1
d)a or b
comment ur answer
(100% Fʀᴇᴇ) Learn CSS – For Beginners || Learn to Work with Cascading Style Sheets…
β–”β–”β–”β–”β–”β–”β–”β–”β–”β–”β–”β–”β–”β–”β–”β–”β–”β–”β–”
πŸ”— Enroll Linkβž› https://studybullet.com/course/learn-css-for-beginners/
▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁
πŸ”· Invite Friendsβž› https://t.me/smw_coding
⚠️ Free for first 500 Enrollments only.