Day: January 10, 2021

Python Examples for Beginners: Python Code to Display Calendar

(Python Tutorials for Citizen Data Scientist) Python Code to Display Calendar Python has a built-in function, calendar to work with date related tasks. You will learn to display the calendar of a given date in this example. In the program below, we import the calendar module. The built-in function month() inside the module takes in the year and the …

Python Examples for Beginners: Python Code to Shuffle Deck of Cards

(Python Tutorials for Citizen Data Scientist) Python Code to Shuffle Deck of Cards In this program, you’ll learn to shuffle a deck of cards using random module. Source Code # Python program to shuffle a deck of card # importing modules import itertools, random # make a deck of cards deck = list(itertools.product(range(1,14),[‘Spade’,’Heart’,’Diamond’,’Club’])) # shuffle …