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))
list = ["xyz","zara","pynative"]
print(max(list))
Python programming codes
what is the output of the python code? list = ["xyz","zara","pynative"] print(max(list))
list = ["xyz","zara","pynative","all"]
print(min(list))
print(min(list))
def x(values):
values[0] = 1
v = [2,3,4] x(v) print(x)
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)
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")
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"))
import datetime
now = datetime.datetime.now()
print("Current date and time")
print(now.strftime("%Yyear%mmonth%dday%Hhours%Mminutes%Sseconds"))
700+ Python MCQ Question and Answers
1. Python Basic MCQ
2. Python Module MCQ
3. String Formatting in Python
4. Python Generators MCQ
5. Python Variable MCQ
6. Python Data Types
7. Python Operator MCQ
8. Python List MCQ
9. Python Tuple MCQ
10. Python Dictionary MCQ
11. Python Set MCQ
12. Python if else MCQ
13. Python While Loop MCQ
14. Python for Loop MCQ
15. Python Functions MCQ
16. Python File Handling
17. Python Errors and Exceptions Handling
1. Python Basic MCQ
2. Python Module MCQ
3. String Formatting in Python
4. Python Generators MCQ
5. Python Variable MCQ
6. Python Data Types
7. Python Operator MCQ
8. Python List MCQ
9. Python Tuple MCQ
10. Python Dictionary MCQ
11. Python Set MCQ
12. Python if else MCQ
13. Python While Loop MCQ
14. Python for Loop MCQ
15. Python Functions MCQ
16. Python File Handling
17. Python Errors and Exceptions Handling
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>
<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);
});
});
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);
});
});
π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
β‘οΈ 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
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
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.
βββββββββββββββββββ
π Enroll Linkβ https://studybullet.com/course/learn-css-for-beginners/
βββββββββββββββββββ
π· Invite Friendsβ https://t.me/smw_coding
β οΈ Free for first 500 Enrollments only.