IN PYTHON
Sample output 1: @w@
Sample output 2: T_T
import random
def print_emoji():
num = random.random()
print(num)
if num <= 0.2:
print("@w@")
elif num <= 0.4:
print("T_T")
elif num <= 0.6:
print(":)")
elif num <= 0.8:
print("^-^")
else:
print("(y)")
print_emoji()
IN PYTHON Write a program that uses a method to display a random text-based emoji out...
Write a python program that generates a list of 50 random numbers. The program should display (with labels) the sum, average, largest, and smallest of the list along with the list before and after sorting. Bonus: Find the mode (if any)
Python Programming Write a program that counts how often a word occurs in a text file. Input: Ask the user for the name of an ASCII text file. Output: Display the numbers of top frequently appeared words and their frequencies. Pseudocode: 1) Read the file 2) Split the file into words 3) Count each word 4) Sort the words by frequencies, starting with the most frequent ones 5) Internally you should use some sort of data structure to keep track...
PYTHON:please display code in python
Part 1: Determining the Values for a Sine
Function
Write a Python program that displays and describes the equation
for plotting the sine function, then prompts the user for the
values A, B, C and D to be used in the calculation. Your program
should then compute and display the values for Amplitude, Range,
Frequency, Phase and Offset.
Example input/output for part 1:
Part 2: Displaying a Vertical Plot Header
A vertical plot of the...
PYTHON CODE First Code: Write a program that uses a text file to store the daysand hours that a user worked in a week. The program should begin by prompting for the number of days worked in the week. It should continue with a loop for input of the days and hours and for writing these to the file, each on its own line. Sample Output (inputs shown in boldface) How many days did you work this week? 5 Enter...
Sum Second Write a shell (text-based) program, called sum_second.py, that opens a text file called stuff.txt with 2 numbers per line separated by commas and prints out the sum of the second numbers on every line. For example, if stuff.txt has the following lines: 500,55 300,45 200,7 400,20 Then the following example output would happen. PS C:\Users\ssiva\Desktop> python sum_second.py Sum: 127 PS C:\Users\ssiva\Desktop>
In python language
Write a program that lets the user play the game of Rock, Paper, Scissors against the computer. The program should work as follows: 1. When the program begins, a random number in the range of 1 and 3 is generated. 1 = Computer has chosen Rock 2 = Computer has chosen Paper 3 = Computer has chosen Scissors (Dont display the computer's choice yet) 2. The user enters his or her choice of “Rock”, “Paper", “Scissors" at...
Write a Python program (using python 3.7.2) that lets the user play the game of Rock, Paper, Scissors against the computer. The program should work as follows. 1. When the program begins, a random number in the range of 1 through 3 is generated. If the number is 1, then the computer has chosen rock. If the number is 2, then the computer has chosen paper. If the number is 3, then the computer has chosen scissors. (Don’t display the...
Write a text analyzer program using Python. The program should prompt the user for text to analyze using the following prompt: Please enter text to analyze or press ENTER (without text) to exit: If the following text is input into by the user: Fog everywhere. Fog up the river, where it flows among green aits and meadows; fog down the river, where it rolls deified among the tiers of shipping and the waterside pollutions of a great (and dirty) city....
please write in python
Write a program that asks for beginning and ending number. The program generates a set of 20 random numbers between the numbers and displays a count of each number generated. Sample output Enter starting and ending number separated by comma: 5, 25 5 occurs 2 times 7 occurs 1 time 8 occurs 1 time 10 occurs 2 times 12 occurs 1 time 13 occurs 2 time 15 occurs 5 times 16 occurs 1 time 20 occurs...
Must be done in python and using linux mint
Write a program to create a text file which contains a sequence of test scores. Each score will be between 0 and 100 inclusive. There will be one value per line, with no additional text in the file. Stop adding information to the file when the user enters -1 The program will first ask for a file name and then the scores. Use a sentinel of -1 to indicate the user...