206k views
5 votes
I'm not sure how to do these. By the way, it has to be python.

I'm not sure how to do these. By the way, it has to be python.-example-1

1 Answer

6 votes

Task 1:

float75 = float(75)

string75 = "75"

# you cannot add together a number and a string because a string has no inherent numerical value like a number does.

Task 2:

num = float(input("Enter a number"))

print(num**2)

Task 3:

num = int(input("Enter an integer: "))

print("When you divide "+str(num)+" by 7, the quotient is "+str(num//7)+" and the remainder is "+str(num%7)+".")

Task 4:

gigs = int(input("How many gigabytes does your flashdrive hold? "))

print("A flashdrive with "+str(gigs)+ " gigabyte(s) holds "+str(gigs*8589934592)+" bit(s).")

For task 4, you might have to change the number 8589934592 to something else. I'm not entirely sure how many bits are in a gigabyte. I hope this helps though.

User Lukeg
by
4.7k points